[systemd-devel] [PATCH 2/2] verbs: allow matching by prefix
Lennart Poettering
lennart at poettering.net
Sun Dec 21 17:08:37 PST 2014
On Sat, 20.12.14 11:19, Dave Reisner (dreisner at archlinux.org) wrote:
> Be nice to command line users and allow matching prefixes of verbs,
> similar to the way getopt_long operates. If the prefix cannot be
> resolved to a singular verb, log the ambiguity and return an error.
> ---
> I'm not thrilled about adding this to every manpage out of concern that it
> might get out of sync, but I don't really see a better way.
Hmm, I am not sure I like the idea of this. I know that getopt works
that way and that some tools (including "ip") do this, but I am not
convinced it's really a great idea. I mean, we keep making changes to
the list of supported verbs, adding new entries and such. If people
make use of the abbreviations this could have the effect that later on
some commands that used to work stop working since something that
wasn't ambiguous become abiguous.
I am all for allowing people to type less, but I think command line
completion is the better answer to that...
Moreover the abbreviated commands certainly don't help readability
either...
In fact due to all of this I'd rather go the other way and find a way
to turn off this magic in getopt_long()...
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list