bogo-cli 0.1.14 → 0.1.16
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/bogo-cli/setup.rb +16 -2
- data/lib/bogo-cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c670e873f40bafcaba50ba35187b1762bfe3dd56
|
4
|
+
data.tar.gz: c77af64b71894e00c8ed25ea54a6a5cf55a456af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41c7b2df9c2775b2c90268eead7c32756f92b85b8abd98afc3a452713cf82a8ddaae4249ccce7d4fb7a775383472f7ec6c4d9398b3a7c09b7defb38320c13f08
|
7
|
+
data.tar.gz: d592dea8aeaf00fc55a7a07bda5a9568d9e15d8ae04baf0b4b3df4bed4a9f731c2e87ee375ec29e2237a3fb065f89c76caaf111af19482dd1030a51fdac1ed86
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## v0.1.16
|
2
|
+
* Output exception message when reporting error to get full content
|
3
|
+
* Trap INT to allow nicer user forced exits
|
4
|
+
* Automatically exit after command block is run
|
5
|
+
* Print help message and exit non-zero when no command is run
|
6
|
+
|
1
7
|
## v0.1.14
|
2
8
|
* Merge namespaced opts with globals when providing options to allow full config load
|
3
9
|
|
data/lib/bogo-cli/setup.rb
CHANGED
@@ -1,6 +1,18 @@
|
|
1
|
+
Signal.trap('INT'){ exit -1 }
|
2
|
+
|
1
3
|
require 'slop'
|
2
4
|
require 'bogo-cli'
|
3
5
|
|
6
|
+
class Slop
|
7
|
+
def bogo_cli_run(*args, &block)
|
8
|
+
slop_run(*args, &block)
|
9
|
+
old_runner = @runner
|
10
|
+
@runner = proc{|*args| old_runner.call(*args); exit 0}
|
11
|
+
end
|
12
|
+
alias_method :slop_run, :run
|
13
|
+
alias_method :run, :bogo_cli_run
|
14
|
+
end
|
15
|
+
|
4
16
|
module Bogo
|
5
17
|
module Cli
|
6
18
|
class Setup
|
@@ -12,14 +24,16 @@ module Bogo
|
|
12
24
|
# @return [TrueClass]
|
13
25
|
def define(&block)
|
14
26
|
begin
|
15
|
-
Slop.parse(:help => true) do
|
27
|
+
slop_result = Slop.parse(:help => true) do
|
16
28
|
instance_exec(&block)
|
17
29
|
end
|
30
|
+
puts slop_result.help
|
31
|
+
exit -1
|
18
32
|
rescue StandardError, ScriptError => e
|
19
33
|
if(ENV['DEBUG'])
|
20
34
|
$stderr.puts "ERROR: #{e.class}: #{e}\n#{e.backtrace.join("\n")}"
|
21
35
|
else
|
22
|
-
$stderr.puts "ERROR: #{e.class}: #{e}"
|
36
|
+
$stderr.puts "ERROR: #{e.class}: #{e.message}"
|
23
37
|
end
|
24
38
|
exit e.respond_to?(:exit_code) ? e.exit_code : -1
|
25
39
|
end
|
data/lib/bogo-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bogo-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bogo
|