ruby_cli 0.0.2 → 0.0.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/bin/hello_world +2 -1
- data/lib/ruby_cli.rb +3 -2
- metadata +3 -3
data/bin/hello_world
CHANGED
data/lib/ruby_cli.rb
CHANGED
@@ -33,12 +33,13 @@ require 'optparse'
|
|
33
33
|
module RubyCLI
|
34
34
|
|
35
35
|
# Initialization of this application requires the command line arguments.
|
36
|
-
def initialize(default_argv)
|
36
|
+
def initialize(default_argv, command_name)
|
37
37
|
@default_argv = default_argv
|
38
38
|
@default_options = {:help => false, :verbose => false}
|
39
39
|
define_command_options
|
40
40
|
define_command_arguments
|
41
41
|
@opt_parser = nil
|
42
|
+
@command_name = command_name
|
42
43
|
end
|
43
44
|
|
44
45
|
# This method can be overwritten if you want to set defaults for your command
|
@@ -67,7 +68,7 @@ module RubyCLI
|
|
67
68
|
def parse_options?
|
68
69
|
#configure an OptionParser
|
69
70
|
@opt_parser = OptionParser.new do |opts|
|
70
|
-
opts.banner = "Usage: #{
|
71
|
+
opts.banner = "Usage: #{@command_name} [OPTIONS]... [ARGUMENTS]..."
|
71
72
|
opts.separator ""
|
72
73
|
opts.separator "Specific options:"
|
73
74
|
opts.on('-h', '--help', 'displays help information') do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Martin Velez
|