Skip to content

Commit

Permalink
Fix CLI params normalization
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Jan 9, 2025
1 parent 884f745 commit 57f7e58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ class CmdRun extends CmdBase implements HubOptions {
addParam((Map)nested, key.substring(p+1), value, path, fullKey)
}
else {
params.put(key.replaceAll(DOT_ESCAPED,'.'), parseParamValue(value))
addParam0(params, key.replaceAll(DOT_ESCAPED,'.'), parseParamValue(value))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,16 @@ class CmdRunTest extends Specification {

when:
def params = [:]
CmdRun.addParam0(params, 'alphaBeta', 1)
CmdRun.addParam0(params, 'alpha-beta', 10)
CmdRun.addParam(params, 'alphaBeta', '1')
CmdRun.addParam(params, 'alpha-beta', '10')
then:
params['alphaBeta'] == 10
!params.containsKey('alpha-beta')

when:
params = [:]
CmdRun.addParam0(params, 'aaa-bbb-ccc', 1)
CmdRun.addParam0(params, 'aaaBbbCcc', 10)
CmdRun.addParam(params, 'aaa-bbb-ccc', '1')
CmdRun.addParam(params, 'aaaBbbCcc', '10')
then:
params['aaaBbbCcc'] == 10
!params.containsKey('aaa-bbb-ccc')
Expand Down

0 comments on commit 57f7e58

Please sign in to comment.