simple-cli 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5b3fd1da7ac1980589b3dcf3854962d4f7bb06f
4
- data.tar.gz: 64bb1a9fa185923f5ff70e8c2fef6925e19964a6
3
+ metadata.gz: b82f6957d9167a66b92ba38862c4e99dfec7a110
4
+ data.tar.gz: 410a5e01f6c238aae72639196c31de3132ffce35
5
5
  SHA512:
6
- metadata.gz: dc26dddd407b128b9eef968efaad716a15e80552bf9458628b86624c7a6b08230adda6efc6d54ec235797f2ece99e966517f32bb7fc7ef0a65644ab95e0968d6
7
- data.tar.gz: 18ee454086edc5cc0d32afe28a2147b6e0c514ffa39e0820961b8a7142f1dee3f6b4c444aca3e4197c1da0c66582a042e94fd1aa4dfccd45b33e8156075b1a70
6
+ metadata.gz: ffd51cc1a8c68b7f18f48d107cb0372bb9df5b8e4c22acefc7669e14f34ad90544c47e09a46cb067895cc0f064e8fcc37dd8f3b5766536d1cc15e8aa26699ebb
7
+ data.tar.gz: d6786981885955ff79d78d6699e26995ffd8052d1e6a0d96198aee6f6528b31445fac3b83620088e9dde0b19f3c2168a1d2e495faa315c6dd2127c141a4aa087
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple-cli (0.2.7)
4
+ simple-cli (0.2.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -55,4 +55,4 @@ DEPENDENCIES
55
55
  simplecov (~> 0)
56
56
 
57
57
  BUNDLED WITH
58
- 1.16.1
58
+ 1.16.2
@@ -32,6 +32,8 @@ class Simple::CLI::Runner
32
32
  end
33
33
  end
34
34
 
35
+ attr_accessor :subcommand
36
+
35
37
  def run(*args)
36
38
  extract_default_flags!(args)
37
39
 
@@ -46,6 +48,7 @@ class Simple::CLI::Runner
46
48
  elsif command == :autocomplete_bash
47
49
  autocomplete_bash(*args)
48
50
  elsif commands.include?(command)
51
+ self.subcommand = command
49
52
  @instance.run! command, *args_with_options(args)
50
53
  else
51
54
  help!
@@ -70,6 +73,8 @@ class Simple::CLI::Runner
70
73
 
71
74
  #{edoc.full}
72
75
  MSG
76
+
77
+ exit 1
73
78
  end
74
79
 
75
80
  def logger
@@ -82,7 +87,11 @@ class Simple::CLI::Runner
82
87
  case e
83
88
  when ArgumentError
84
89
  logger.error "#{e}\n\n"
85
- help!
90
+ if subcommand
91
+ help_subcommand! subcommand
92
+ else
93
+ help!
94
+ end
86
95
  else
87
96
  msg = e.to_s
88
97
  msg += " (#{e.class.name})" unless $!.class.name == "RuntimeError"
@@ -1,5 +1,5 @@
1
1
  module Simple
2
2
  module CLI
3
- VERSION = "0.2.7"
3
+ VERSION = "0.2.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-04 00:00:00.000000000 Z
12
+ date: 2018-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake