Skip to content

Commit b3866ea

Browse files
committed
cleanup
1 parent 97a2e6b commit b3866ea

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

lib/bashly/config_validator.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def assert_command(key, value)
112112
assert_hash key, value, Script::Command.option_keys
113113

114114
refute value['commands'] && value['args'], "#{key} cannot have both commands and args"
115+
refute value['commands'] && value['catch_all'], "#{key} cannot have both commands and catch_all"
115116

116117
assert_string "#{key}.name", value['name']
117118
assert_optional_string "#{key}.help", value['help']
@@ -150,10 +151,6 @@ def assert_command(key, value)
150151
refute repeatable_arg, "#{key}.catch_all makes no sense with repeatable arg (#{repeatable_arg})"
151152
end
152153

153-
if value['catch_all']
154-
refute value['commands'], "#{key}.catch_all makes no sense with commands"
155-
end
156-
157154
if value['expose']
158155
assert value['commands'], "#{key}.expose makes no sense without commands"
159156
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#<Bashly::ConfigurationError: root.catch_all makes no sense with commands>
1+
#<Bashly::ConfigurationError: root cannot have both commands and catch_all>

spec/fixtures/script/validations.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,6 @@
102102
args:
103103
- name: source
104104

105-
# :commands_and_flags:
106-
# name: invalid
107-
# help: there are both commands and flags
108-
# commands:
109-
# - name: sub
110-
# flags:
111-
# - long: --force
112-
113105
:commands_default_without_args:
114106
name: invalid
115107
help: default command requires args

0 commit comments

Comments
 (0)