Bug 1278291 - The OPTIONS place mismatch in different atomic-openshift-installer Usage
Summary: The OPTIONS place mismatch in different atomic-openshift-installer Usage
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Devan Goodwin
QA Contact: Ma xiaoqiang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-05 07:58 UTC by Anping Li
Modified: 2016-07-04 00:46 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-13 14:33:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Anping Li 2015-11-05 07:58:01 UTC
Description of problem:

if we put OPTIONS after COMMAND, atomic-openshift-installer  will pop up Error.

'atomic-openshift-installer  --help' show OPTIONS should be prior to COMMAND, While 'atomic-openshift-installer upgrade  --help' show OPTIONS should be at the back of COMMAND. 


Version-Release number of selected component (if applicable):
atomic-openshift-utils-3.0.7-1.git.48.75d357c.el7aos.noarch


How reproducible:
always

Steps to Reproduce:

1.atomic-openshift-installer upgrade -c ansible.config
Error: no such option: -c

2.  atomic-openshift-installer 
Usage: atomic-openshift-installer [OPTIONS] COMMAND [ARGS]...

3. atomic-openshift-installer upgrade  --help
Usage: atomic-openshift-installer upgrade [OPTIONS]


Actual Result:
The OPTIONS place mismatch in different help description.

Expected Result:
The OPTIONS location should be accurate.


Additional info:

Comment 1 Devan Goodwin 2015-11-13 14:33:31 UTC
This is the behavior I would prefer as well, unfortunately we use the python Click library which explicitly does not agree with us: http://click.pocoo.org/5/commands/#passing-parameters

I attempted to pursue a decorator solution similar to the one in: https://github.com/mitsuhiko/click/issues/108

However this gets complicated as well. In the current form, all options then transfer to the subcommand and must be specified *after* install / uninstall / upgrade. They will not show up in "atomic-openshift-installer --help" either, but they would show up in "atomic-openshift-installer install --help".

I cannot specify them in both places without things getting very ugly.

So our options are (1) use what we have today, or (2) specify all cli args *after* the sub-command, which will break CLI commands shipping with 3.1. 

Another other solution will probably require going to a different CLI library entirely.

The reasoning behind click's decision to only support (1) is pretty logical and clean, even if it's not as user friendly as we would like. 

I'm going to assume we should keep it as it is today for now, please reopen this bug if QE feels strongly otherwise and I can use my implementation for (2) instead.


Note You need to log in before you can comment on or make changes to this bug.