command-line-favs 0.0.1 → 0.1.0

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: 6bd5d33d21e6787c2c179a69d1f9fc8eec6f210c
4
- data.tar.gz: 1d56cca67075349dc1a2ae72255e4150ab39a099
3
+ metadata.gz: ce071cfe235b3f7415d36942c89eb1db8d7f05bb
4
+ data.tar.gz: 6c744e9d6d5c220bfb6f8719d2c21a8be54997f7
5
5
  SHA512:
6
- metadata.gz: 0e4c8b52eae961faafdf53d09df3b6f27f29fd29ef81239844a55f8265eea051aea1ed053773838c228696da830b1af6884200e7325eea5f825b662109d572ab
7
- data.tar.gz: a34a21249d9765193e709570dcbc48947881ccc075ba686493e245542ff1a874e360589d27f7ba182e11a8f09803cacb9a9327775674306e5b8eb7dd15b61591
6
+ metadata.gz: 5a5166ff8fce264ba7b6bc8d8589c90ab348864290442e01ab8e9c26f4ed03f933a8310e92e393654da499b7c2f8d94ac7e4dd7ec9f5727ae66bbf5be8f21951
7
+ data.tar.gz: 9323b433d668d6f618be33e45115c2586cf8d6befff98b35fcb23d48d6a5def1ef6c2f1438bac993217de488d0d9f4537e9979a3c8e9a919af7c3407fa117e50
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- command-line-favs (0.0.1)
4
+ command-line-favs (0.1.0)
5
5
  highline (~> 1.6)
6
6
  methadone (~> 1.4)
7
7
  parseconfig (~> 1.0)
data/README.md CHANGED
@@ -4,6 +4,16 @@ Command Line Favs is a CLI utility for organizing your commonly used shell comma
4
4
 
5
5
  A *~/.favs* file might look something like:
6
6
 
7
+ # Installation
8
+
9
+ Command Line Favs is packaged a ruby gem. To install run:
10
+
11
+ ```
12
+ gem install command-line-favs
13
+ ```
14
+
15
+ # Documentation
16
+
7
17
  ```
8
18
  #comments are supported so are un-grouped commands like this one
9
19
  #positional-based substitution is also suported
@@ -77,13 +87,13 @@ You can also always manually remove a *Fav* by modifying your *~/.favs* file.
77
87
  List favs within a group:
78
88
 
79
89
  ```
80
- fav -ls -g ssh
90
+ fav -l -g ssh
81
91
  ```
82
92
 
83
93
  List all commands:
84
94
 
85
95
  ```
86
- fav -ls -g
96
+ fav -l -g
87
97
  ```
88
98
  ## Run a Fav
89
99
 
@@ -106,3 +116,8 @@ $ fav -g TestGroup --no_prompt
106
116
  ```
107
117
 
108
118
  When running an entire group of commands the default behavior is to prompt on each command. This can be overridden by supplying the *--no_prompt* flag.
119
+
120
+ ## Future enhancements
121
+
122
+ * Tab completion for groups and commands
123
+ * Support the running of bash/zsh built-in commmands
data/bin/fav CHANGED
@@ -18,7 +18,7 @@ class App
18
18
 
19
19
  #Define flags
20
20
  on("-a COMMAND_TEXT","--add", "Add a command to the list of favorites")
21
- on("-ls", "--list", "List available commands")
21
+ on("-l", "--list", "List available commands")
22
22
  on("-g GROUP_NAME","--group", "If used with -a flag, will add command to group. Otherwise will run command within group")
23
23
  on("-r","--remove", "Remove a command from the list of favorites")
24
24
  #
@@ -111,7 +111,7 @@ Feature: Run and save commands
111
111
  ef = "echo Foo"
112
112
  eb = "echo Bar"
113
113
  """
114
- When I run `fav -ls -g test`
114
+ When I run `fav -l -g test`
115
115
  Then it should pass with exactly:
116
116
  """
117
117
  ef = "echo Foo"
@@ -127,7 +127,7 @@ Feature: Run and save commands
127
127
  ef = "echo Foo"
128
128
  eb = "echo Bar"
129
129
  """
130
- When I run `fav -ls`
130
+ When I run `fav -l`
131
131
  Then it should pass with exactly:
132
132
  """
133
133
  ug = "echo ungrouped"
data/lib/fav.rb CHANGED
@@ -86,10 +86,10 @@ module Fav
86
86
  when 'Y', 'C'
87
87
  sh value
88
88
  when 'B'
89
- puts 'Breaking the execution of all remaining commands in group.'
89
+ info 'Breaking the execution of all remaining commands in group.'
90
90
  break
91
91
  else #'N' or some unrecognized option
92
- puts "Skipping the execution of #{value}"
92
+ info "Skipping the execution of #{value}"
93
93
  end
94
94
  end
95
95
  end
@@ -97,6 +97,7 @@ module Fav
97
97
 
98
98
  # Run non-grouped command
99
99
  def on_non_group
100
+ CommandFactory.command_name_check(self.command_name, 'Running')
100
101
  run_cmd self.config[self.command_name]
101
102
  end
102
103
 
@@ -150,13 +151,13 @@ module Fav
150
151
  # Add a grouped fav
151
152
  def on_group(group)
152
153
  self.config.add_to_group(group, self.command_name, self.cli_options[:add])
153
- puts "Successfully added #{self.command_name} to the '#{group}' group!"
154
+ info "Successfully added #{self.command_name} to the '#{group}' group!"
154
155
  end
155
156
 
156
157
  # Add a non-grouped fav
157
158
  def on_non_group
158
159
  self.config.add(self.command_name, self.cli_options[:add])
159
- puts "Successfully added #{self.command_name}"
160
+ info "Successfully added #{self.command_name}!"
160
161
  end
161
162
  end
162
163
 
@@ -167,13 +168,13 @@ module Fav
167
168
  #raise error if command they are attempting to remove doesn't exist
168
169
  raise "Can not remove command because it doesn't exist" unless self.config[group][self.command_name]
169
170
  self.config[group].delete(self.command_name)
170
- puts "Successfully removed #{self.command_name} from the '#{group}' group!"
171
+ info "Successfully removed #{self.command_name} from the '#{group}' group!"
171
172
  end
172
173
 
173
174
  # Remove a non-grouped fav
174
175
  def on_non_group
175
176
  self.config.params.delete(self.command_name)
176
- puts "Successfully removed #{self.command_name}"
177
+ info "Successfully removed #{self.command_name}"
177
178
  end
178
179
  end
179
180
  end
data/lib/fav/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fav
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: command-line-favs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bake