cliff apps fail to detect command name when called apps are called as python modules
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cliff |
Fix Released
|
Undecided
|
Sorin Sbarnea |
Bug Description
Python has one standard way to call modules as scripts, via `python -m modulename`. When this is done python is calling modulename/
Most python based tools do support this (pip, flake8, tox, ...) but apperently cliff does not.
First this should be added to demoapp and we also need to assure that one bug is sorted because at this moment, people may face an undexpected bug:
>modulename --version
modulename 1.2.3
>python -m modulename --version
__main__ 1.2.3
This is caused by the code inside cliff which assumes that the command name is taken from sys.argv[0], which in case of module calling, is not really useful.
This may seem as a minor bug but because cliff is used by so many tools, it prevents their users from implementing the module calling correctly and we should fix it ASAP.
Changed in python-cliff: | |
status: | New → Fix Released |
https:/ /review. openstack. org/#/c/ 579025/ should address it.