Skip to content

Commit d4c4427

Browse files
committed
Allow to pass value starting with '-' on config subcmd
Allow to pass configuration option value starting with minus sign (-) on config sub-command. Was previously mistaken with command-line switches. This change allows to subtract a value to a configuration option already set.
1 parent 427b07e commit d4c4427

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tcl/main.tcl.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,9 +1067,10 @@ if {[catch {
10671067
lassign [parseModuleCommandName $subcmdtest {}]\
10681068
subcmdtest
10691069
}
1070-
# accepted if command is ml or if adv vers spec is enabled
1071-
# and command can receive boolean variant specification
1072-
set accept_minus_arg [expr {$subcmdtest eq {ml} ||\
1070+
# accepted if command is ml or config or if adv vers spec is
1071+
# enabled and command can receive boolean variant
1072+
# specification
1073+
set accept_minus_arg [expr {$subcmdtest in {ml config} ||\
10731074
([getConf advanced_version_spec] && $subcmdtest in\
10741075
{avail list display help is-avail is-loaded load path\
10751076
paths switch test unload whatis mod-to-sh source})}]

testsuite/modules.70-maint/220-config.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ foreach param [array names configvalid] {
277277

278278
# invalid value test
279279
set tserr [if_configlocked $param [err_conflocked $param] "$error_msgs: Invalid value for configuration option '$param'\n Value should be an integer comprised between $lowerbound and $upperbound"]
280-
testouterr_cmd_re sh "config $param -10" ERR "$error_msgs: Invalid option '-10'\n$err_typehelp"
280+
testouterr_cmd_re sh "config $param -10" ERR $tserr
281281
testouterr_cmd_re sh "config $param [expr {$upperbound + 10}]" ERR $tserr
282282
testouterr_cmd_re sh "config $param foo" ERR $tserr
283283
}

0 commit comments

Comments
 (0)