ppcommand 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
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
- -y, --yaml parse YAML and pp.
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
- -c, --csv parse CSV and pp.
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.2
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.on("-y", "--yaml", "parse YAML and pp."){|x| opts[:type] = "yaml"}
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("-c", "--csv", "parse CSV and pp."){|x| opts[:type] = "csv"}
87
- opp.on("-C", "--csvtable", "parse CSV, add labels and pp."){|x| opts[:type] = "csvhash"}
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ppcommand}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["KOSEKI Kengo"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ppcommand
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - KOSEKI Kengo