ppcommand 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +7 -4
- data/VERSION +1 -1
- data/lib/ppcommand.rb +15 -4
- data/ppcommand.gemspec +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -6,14 +6,17 @@ Parse and pp YAML/JSON/XML/CSV/HTML.
|
|
6
6
|
|
7
7
|
$ pp --help
|
8
8
|
pp [options] [file|URI]
|
9
|
-
-
|
9
|
+
-c, --csv parse CSV and pp.
|
10
|
+
-C, --csvtable parse CSV, add labels and pp.
|
11
|
+
-H, --html parse HTML and pp.
|
10
12
|
-j, --json parse JSON and pp.
|
11
13
|
-x, --xml parse XML using REXML and pp.
|
12
14
|
-X, --xmlsimple parse XML using XMLSimple and pp.
|
13
|
-
-
|
14
|
-
-C, --csvtable parse CSV, add labels and pp.
|
15
|
-
-h, --html parse HTML and pp.
|
15
|
+
-y, --yaml parse YAML and pp.
|
16
16
|
-t, --text do not parse. print plain text.
|
17
|
+
-h, --help show this help.
|
18
|
+
-v, --version show version.
|
19
|
+
|
17
20
|
|
18
21
|
== Examples
|
19
22
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/lib/ppcommand.rb
CHANGED
@@ -79,14 +79,25 @@ class PPCommand
|
|
79
79
|
opp = OptionParser.new
|
80
80
|
|
81
81
|
opp.banner = "pp [options] [file|URI]"
|
82
|
-
opp.
|
82
|
+
opp.on_tail("-h", "--help", "show this help.") do
|
83
|
+
puts opp
|
84
|
+
exit
|
85
|
+
end
|
86
|
+
opp.on_tail("-v", "--version", "show version.") do
|
87
|
+
puts "ppcommand " + File.read(File.dirname(__FILE__) + "/../VERSION")
|
88
|
+
exit
|
89
|
+
end
|
90
|
+
|
91
|
+
opp.on("-c", "--csv", "parse CSV and pp."){|x| opts[:type] = "csv"}
|
92
|
+
opp.on("-C", "--csvtable", "parse CSV, add labels and pp."){|x| opts[:type] = "csvhash"}
|
93
|
+
opp.on("-H", "--html", "parse HTML and pp."){|x| opts[:type] = "html"}
|
83
94
|
opp.on("-j", "--json", "parse JSON and pp."){|x| opts[:type] = "json"}
|
84
95
|
opp.on("-x", "--xml", "parse XML using REXML and pp."){|x| opts[:type] = "xml"}
|
85
96
|
opp.on("-X", "--xmlsimple", "parse XML using XMLSimple and pp."){|x| opts[:type] = "xmlsimple"}
|
86
|
-
opp.on("-
|
87
|
-
|
88
|
-
opp.on("-h", "--html", "parse HTML and pp."){|x| opts[:type] = "html"}
|
97
|
+
opp.on("-y", "--yaml", "parse YAML and pp."){|x| opts[:type] = "yaml"}
|
98
|
+
|
89
99
|
opp.on("-t", "--text", "do not parse. print plain text."){|x| opts[:type] = "text"}
|
100
|
+
|
90
101
|
opp.parse!(argv)
|
91
102
|
|
92
103
|
file = argv.shift
|
data/ppcommand.gemspec
CHANGED