Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Fixing short-form optparse options #6388

Merged
merged 1 commit into from
May 23, 2016

Conversation

thrasher-redhat
Copy link
Contributor

Bug 1311730
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1311730

Errors were being seen when command line tools using the 'optparse' libary.
Using long-form only options with a single dash was resulting in odd returns,
but no errors. This is because optparse automatically infers a short-form
option for long-form options that have a unique starting letter. So '--ids' has
an implied short-form of '-i'. This meant that running a command with '-ids'
would actually use '-i' and pass in "ds" as an ID value. This commit takes
several cases where this happens and explicitely defines the short-form options
in the relevant scripts and man pages, which should reduce confusion on why
certain options may not error out as expected.

Also updates an old man page to reflect the current options.

Bug 1311730
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1311730

Errors were being seen when command line tools using the 'optparse' libary.
Using long-form only options with a single dash was resulting in odd returns,
but no errors.  This is because optparse automatically infers a short-form
option for long-form options that have a unique starting letter.  So '--ids' has
an implied short-form of '-i'.  This meant that running a command with '-ids'
would actually use '-i' and pass in "ds" as an ID value.  This commit takes
several cases where this happens and explicitely defines the short-form options
in the relevant scripts and man pages, which should reduce confusion on why
certain options may not error out as expected.

Also updates an old man page to reflect the current options.
@tiwillia
Copy link
Member

LGTM

Since we don't have any automated tests that cover these scripts (and most of your changes just result in help page changes), I tested these myself. Did not find any problem with the modified admin scripts and saw the options in the help pages where expected.

[merge]

@openshift-bot
Copy link

openshift-bot commented May 23, 2016

Online Merge Results: SUCCESS (https://ci.dev.openshift.redhat.com/jenkins/job/merge_pull_requests/6733/) (Image: devenv_5794)

@openshift-bot
Copy link

Evaluated for online merge up to 3b5dcf0

@openshift-bot openshift-bot merged commit feaf88b into openshift:master May 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants