Skip to content

Conversation

@DavidMarchant
Copy link
Contributor

@DavidMarchant DavidMarchant commented Nov 20, 2018

Fixes #179

generally makes tool arguments more robust

Stops breakage if an argument is just an integer
Stops breakage if argument contains any uppercase characters and handles this as well as possible. All argument names are treated as lowercase, so input, INPUT and InPuT are one and the same.
This is the best possible outcome as we loose info when a command's callback is called by click code; the dict that returns is downcased.
https://github.com/alces-software/adminware/blob/develop/src/appliance_cli/command_generation.py#L136

WilliamMcCumstie and others added 3 commits November 20, 2018 17:05
Arguments are passed to the click callback (from click code) in
lowercase. It's necessary we treat all arguments as lowercase also
to prevent errors interfacing with this.
Prevent issues rising from args being treated as ints
They are later `strip`ed which would cause a breaking bug
The change so that argument names are downcased in order
to match their values returned as from click (the commit before last)
moved the problem such that there would be miss-match between the
argument names stored by the system and those specified in the tool's
cmd. This resulted in arguments not being used.

This commit searches through a tools cmd on execution to fix this
miss-match by replacing all instances with downcased versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants