diff --git a/spec/fixtures/vehicles.tabry b/spec/fixtures/vehicles.tabry index 9812b11..070df4d 100644 --- a/spec/fixtures/vehicles.tabry +++ b/spec/fixtures/vehicles.tabry @@ -8,7 +8,7 @@ desc "Build and control vehicles" flag verbose,v "Give more details in output" sub build { - varargs vehicle-types @vehicle-type-arg + varargs vehicle-types @vehicle-type } sub list-vehicles diff --git a/spec/fixtures/vehicles.yaml b/spec/fixtures/vehicles.yaml index 2e44825..bd7cad1 100644 --- a/spec/fixtures/vehicles.yaml +++ b/spec/fixtures/vehicles.yaml @@ -12,7 +12,7 @@ main: - name: vehicle-types options: - type: include - value: vehicle-type-arg + value: vehicle-type varargs: true - name: list-vehicles - name: move diff --git a/spec/tabry/options_finder_spec.rb b/spec/tabry/options_finder_spec.rb index 4e58285..00b2144 100644 --- a/spec/tabry/options_finder_spec.rb +++ b/spec/tabry/options_finder_spec.rb @@ -4,6 +4,7 @@ require_relative "../../lib/tabry/options_finder" require_relative "../../lib/tabry/result" require_relative "../../lib/tabry/state" +require_relative "../../lib/tabry/util" describe Tabry::OptionsFinder do let(:config_fixture) { "#{__dir__}/../fixtures/vehicles.yaml" } @@ -23,6 +24,10 @@ %w[car bike], subs: %w[move go] ], + "lists options for varargs" => [ + %w[car bike], + subs: %w[build], + ], "lists both possible args and subs if a subcommand can take either" => [ %w[x y z subsub], subs: %w[sub-with-sub-or-arg]