hsume2-aka 0.3.0 → 0.3.1

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: ff1a4426d8acd44942815927f6598abeced762cf
4
- data.tar.gz: 5c595720a99c74f596a9ea20a47daf510d75af34
3
+ metadata.gz: c5d026442f9c86fc72053c46721c16483392b992
4
+ data.tar.gz: c5707953396d050400fa42d4717ce90e21606ff0
5
5
  SHA512:
6
- metadata.gz: 660d9898f7a0e020ee5f847d52eba91cb686d1b41414b13aa56ee92db4780ceb3d2a9363914593e7d66522683d149705f7f64f46e1d94b9cea2be23e97e5718c
7
- data.tar.gz: e757d3583c75e7670a66aad84b75d5442024f170ab28c14325f7ecca254194b2d22d803541bc2a9b70a0f453ab7ebd3de7cc30037ecae6e73da2512352d7cb93
6
+ metadata.gz: d36fdfee6a566e2363e743cee1a83f9c5f370cd1f41c29454b5de026efa6a7590176b63f69256a5bd1627c656275a6e3a4ef5db2147eadff88ba37043a10f0b8
7
+ data.tar.gz: 6eea6f22ff1654595ccdd695fd4a52cf1d1da49dcb6ff1c46bce4ae3e459020417b97dbb5edd9e6dd0197d983fc2db55d4819b5b1bb649f41752ba04c77864b8
data/README.md CHANGED
@@ -95,7 +95,15 @@ Add a link:
95
95
 
96
96
  Remove a link:
97
97
 
98
- $ aka link --delete --tag os:linux --output ~/.aka.zsh
98
+ $ aka list
99
+ ...
100
+ =====
101
+ Links
102
+ =====
103
+
104
+ [1] ~/.aka.zsh: #osx, #git
105
+ [2] ~/.aka.zsh: #linux, #git
106
+ $ aka link delete 2
99
107
  Removed link.
100
108
 
101
109
  Synchronize links:
@@ -24,12 +24,20 @@ Feature: Help with aka
24
24
  aka - Manage Shell Keyboard Shortcuts
25
25
  """
26
26
 
27
+ Scenario: Get help with invalid arguments
28
+ When I run `aka -z`
29
+ Then the exit status should be 64
30
+ And the output should contain:
31
+ """
32
+ aka - Manage Shell Keyboard Shortcuts
33
+ """
34
+
27
35
  Scenario: Get version
28
36
  When I run `aka --version`
29
37
  Then the exit status should be 0
30
38
  And the output should contain exactly:
31
39
  """
32
- aka version 0.3.0
40
+ aka version 0.3.1
33
41
 
34
42
  """
35
43
 
data/lib/aka/app.rb CHANGED
@@ -17,6 +17,25 @@ module Aka
17
17
  end
18
18
  end
19
19
 
20
+ def self.go!
21
+ setup_defaults
22
+ opts.post_setup
23
+ opts.parse!
24
+ opts.check_args!
25
+ result = call_main
26
+ if result.kind_of? Fixnum
27
+ exit result
28
+ else
29
+ exit 0
30
+ end
31
+ rescue OptionParser::ParseError => ex
32
+ logger.error ex.message
33
+ puts
34
+ store = Aka::Store.new
35
+ store.help(nil, nil)
36
+ exit 64 # Linux standard for bad command line
37
+ end
38
+
20
39
  main do |command, shortcut, script|
21
40
  if options[:version]
22
41
  puts "aka version #{Aka::VERSION}"
@@ -28,7 +47,10 @@ module Aka
28
47
 
29
48
  store = Aka::Store.new
30
49
 
31
- store.help(command, options) and exit if options[:help]
50
+ if options[:help]
51
+ store.help(command, options)
52
+ exit
53
+ end
32
54
 
33
55
  case command
34
56
  when 'add'
@@ -55,6 +77,7 @@ module Aka
55
77
  store.sync(shortcut ? shortcut.to_i : nil)
56
78
  else
57
79
  store.help(command, options)
80
+ exit
58
81
  end
59
82
  end
60
83
 
data/lib/aka/store.rb CHANGED
@@ -33,7 +33,6 @@ module Aka
33
33
  Kernel.exec "man #{root}/#{command}"
34
34
  else
35
35
  puts File.read("#{root}/#{command}.txt")
36
- exit
37
36
  end
38
37
  end
39
38
 
data/lib/aka/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Aka
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hsume2-aka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Hsu