qb 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/qb +24 -2
  3. data/lib/qb/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f31d035d37daaec64eee867197075bf51e2d8c02
4
- data.tar.gz: c59ffaac71ca22f403d038fa0d75c9077edfc799
3
+ metadata.gz: 54687128688607e61d8014d9ff30313dfa384f31
4
+ data.tar.gz: 317c700f6509ab626d48a84265aa039aa4284c5e
5
5
  SHA512:
6
- metadata.gz: 803936e367ab858f49cbabc29772e8a44627bc881ce115cb1c178036e6f5ff47f435049e31e7a48db3d4d6e2fff7666221ca4b45608f3fe9204c128c90afd930
7
- data.tar.gz: bbbfc4fb4bb756e6658cb86bde22c7f8149709444c06db5c2abdc8a7599285c2bc0bcfbd06ec403c2e3c4493f33dd0aa4a84180b4dbd503fa3ff5d31c6964faa
6
+ metadata.gz: e4f727fdd46c64547cf5034c23bf9dcc5217f3c7af51ae660cc2684c68b4581453633478cf3ce97098e297022b033e7f8521404685dabb5eae63fb7e1af81479
7
+ data.tar.gz: 6fc724c46b9946ee5121289f1dfd54cd6e57c008ea9f4b703ca9f08d9d34eb7a0ced62f363a94ebd4b9f12319a1020b38564476067b9d25314a589f0fa3052ba
data/exe/qb CHANGED
@@ -157,6 +157,22 @@ def parse! role_arg, var_prefix, vars, defaults, args
157
157
  options
158
158
  end
159
159
 
160
+ def help
161
+ puts <<-END
162
+ syntax:
163
+
164
+ qb ROLE [OPTIONS] DIRECTORY
165
+
166
+ use `qb ROLE -h` for role options.
167
+
168
+ available roles:
169
+
170
+ END
171
+ puts ROLES
172
+ puts
173
+ exit 1
174
+ end
175
+
160
176
  def main args
161
177
  set_debug! args
162
178
  debug args: args
@@ -164,6 +180,8 @@ def main args
164
180
  role_arg = args.shift
165
181
  debug "role arg" => role_arg
166
182
 
183
+ help if role_arg.nil? || ['-h', '--help', 'help'].include?(role_arg)
184
+
167
185
  matches = ROLES.select {|role|
168
186
  role.include? role_arg
169
187
  }
@@ -171,11 +189,15 @@ def main args
171
189
 
172
190
  role = case matches.length
173
191
  when 0
174
- raise ArgumentError, "no roles match arg #{ role_arg.inspect }"
192
+ puts "ERROR - no roles match arg #{ role_arg.inspect }\n\n"
193
+ help
175
194
  when 1
176
195
  matches[0]
177
196
  else
178
- raise ArgumentError, "multiple role matches: #{ matches.inpsect }"
197
+ puts "ERROR - multiple role matches:\n\n"
198
+ puts matches
199
+ puts
200
+ exit 1
179
201
  end
180
202
  debug role: role
181
203
 
@@ -1,3 +1,3 @@
1
1
  module QB
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - nrser