Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 421157 - app-portage/layman-2.0.0_rc3 has slack argument parsing
Summary: app-portage/layman-2.0.0_rc3 has slack argument parsing
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Brian Dolbec
Depends on:
Reported: 2012-06-14 19:59 UTC by Bernd Buschinski
Modified: 2014-07-11 22:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Buschinski 2012-06-14 19:59:14 UTC
app-portage/layman-2.0.0_rc3 has 2 valid long sync arguments
--sync and --sync-all

but layman also accepts:
layman --sync-al
layman --sync-a
layman --sync-

which IMHO is just wrong.

as it does not accept:
layman --syn
layman --sy
or soone

Reproducible: Always
Comment 1 Brian Dolbec gentoo-dev 2012-06-19 00:28:27 UTC
Cool, never noticed that from layman before.

Actually this is either a feature or bug of python's optparse module which is what layman is currently using to handle the command line options and processing.

I believe it to actually be a feature.  My testing shows abbreviating will work for any of the options.  In the case of --sync and --sync-all.  It required a minimum of --sync which is common to both options.  Providing one additional character making it --sync- was enough to determine you were wanting --sync-all.

I also tested --del for --delete with the same results.

Since the optparse module is deprecated I will be migrating to the argsparse module which is replacing it.  I wonder if argsparse does the same???

I'll do some more checking.
Comment 2 Devan Franchini (RETIRED) gentoo-dev 2014-07-11 22:15:36 UTC
After migrating from optparse to argparse, this still persists. I would say there isn't much we can do about this.

I'm going to mark it as CANTFIX simply because it's out of our hands.

If I'm wrong then you are welcome to open it again and let me know. :)