motivator 1.0.3 → 1.0.4
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.
- checksums.yaml +8 -8
- data/lib/command_parser.rb +9 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NGQwMTcyOWNmYjkxNjA4MmU1ZTlhZTUyZDUwNDA4Yjk5NzBiZWNkMw==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
OTNkNDdiYzZlY2VlMjIzNWMyYmRlOTY5NzgyMDAyYTJhOTdlYTk5Mg==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
MTdjNDczNzUzZjM3N2VhNzg1NzQ4MWNiZGVlMmFkN2EwYzVmZGY1NzJhMWNl
|
|
10
|
+
MWMxMzQ3MGMyOTVlMTY0ZTMwZDFlN2YzYTkxZDE5NDM4N2FlYWRkYzEwZWY1
|
|
11
|
+
N2MxNTE4YzFlZjEzZmE2MmRhMzMzMGE2YzdkZmNhY2YyNjBjZDM=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
NWVmNGY4MTFiNDk5ZTdiOTE5Y2UxYWQ4ZWZhMGIwODM3ZTMzZmU5MmRjNGMx
|
|
14
|
+
MmRmNTYwM2MxYzlkYzliZWUyNmIyYmMwOTNiNTcwMDhkNGU1ZDI0NTAyN2Nk
|
|
15
|
+
NTU5MDk3MTU5OGQ2MmViNjVjYjAxNDE0Y2Q0NzNjMjI1MTIwMGI=
|
data/lib/command_parser.rb
CHANGED
|
@@ -6,6 +6,7 @@ class CommandParser
|
|
|
6
6
|
def initialize config
|
|
7
7
|
@config = config
|
|
8
8
|
@options = options
|
|
9
|
+
@help_called = false
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
# default options
|
|
@@ -32,8 +33,9 @@ class CommandParser
|
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
opts.on_tail('-h', '--help', '# Output command line help options') do
|
|
36
|
+
@help_called = true
|
|
35
37
|
puts opts
|
|
36
|
-
exit
|
|
38
|
+
exit(1)
|
|
37
39
|
end
|
|
38
40
|
end
|
|
39
41
|
|
|
@@ -42,14 +44,16 @@ class CommandParser
|
|
|
42
44
|
begin
|
|
43
45
|
parser.parse!(arguments)
|
|
44
46
|
rescue Exception => e
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
if not(e.kind_of? SystemExit)
|
|
48
|
+
puts parser
|
|
49
|
+
exit(1)
|
|
50
|
+
end
|
|
47
51
|
end
|
|
48
52
|
|
|
49
53
|
# if no valid methods were set we can't execute and therefore we exit and
|
|
50
54
|
# put the parser message to the console
|
|
51
|
-
if @options[:method].nil?
|
|
52
|
-
puts parser
|
|
55
|
+
if @options[:method].nil?
|
|
56
|
+
puts parser if not @help_called
|
|
53
57
|
exit(1)
|
|
54
58
|
end
|
|
55
59
|
|