simple-cli 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8806833d77aa2c4e1c4ba7ed10ac0945e11e9e5f
4
- data.tar.gz: 5e444bf139b52082aa7308bdc432eba4037dc2aa
3
+ metadata.gz: 1fe1d22e8204e5a34ef9b543d0357d17dc7c5b5b
4
+ data.tar.gz: 7211fa7d521310ea21a4646327fe78845e274412
5
5
  SHA512:
6
- metadata.gz: de98dea9484600fa3cbda2f98c3c9baa6bb6ab7eb48a9c77b886f46146d04c0409157b95cda1404e580ab8a4a0aaef7b80e04c9dfdf783ec1d86271dee7a5519
7
- data.tar.gz: 122ac23744b706423991bc0a94f5aa620804ebf06b27ebe374e6814357a6d9177e45ae2191ea962111b18f6bd06dc8e43defb73ccae06823f50841604ec013d1
6
+ metadata.gz: d3917ea01b33fff5dd5826c69334fe9138bd97c9fccabf4877d70b0a9406bdde6d485354ebfdbcf204e2b4e30142ebc16f5d199648127b0445e25594ecde9367
7
+ data.tar.gz: aa8fa6cd5c1af25df3596c95411fcaa5449e3c3aaf3f15da7f62bf4ca886d7592b1f28533beb116d1e490bbe130e7f5faea93f188f1012975a569c95296242ab
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple-cli (0.2.0)
4
+ simple-cli (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -31,13 +31,15 @@ module Simple::CLI::Runner::Autocompletion
31
31
  end
32
32
 
33
33
  def autocomplete_subcommand_options(subcommand, cur)
34
- completions = if subcommand == "help"
35
- commands.map(&:to_s).map { |s| s.tr("_", ":") } + ["autocomplete"]
36
- else
37
- CommandHelp.option_names(@app, string_to_command(subcommand))
38
- end
39
-
40
- filter_completions completions, prefix: cur
34
+ if subcommand == "help"
35
+ completions = commands.map(&:to_s).map { |s| s.tr("_", ":") } + ["autocomplete"]
36
+ filter_completions completions, prefix: cur
37
+ elsif cur[0,1] == "-"
38
+ completions = CommandHelp.option_names(@app, string_to_command(subcommand))
39
+ filter_completions completions, prefix: cur
40
+ else
41
+ Dir.glob "#{cur}*"
42
+ end
41
43
  end
42
44
 
43
45
  def autocomplete_help
@@ -1,5 +1,5 @@
1
1
  module Simple
2
2
  module CLI
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
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.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel