Bug 1278291 - The OPTIONS place mismatch in different atomic-openshift-installer Usage
The OPTIONS place mismatch in different atomic-openshift-installer Usage
Status: CLOSED WONTFIX
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer (Show other bugs)
3.0.0
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Devan Goodwin
Ma xiaoqiang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-05 02:58 EST by Anping Li
Modified: 2016-07-03 20:46 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-13 09:33:31 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Anping Li 2015-11-05 02:58:01 EST
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 09:33:31 EST
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.