Use of "?" for help has been deprecated for 8 years, can we drop it?
Markus Armbruster
Reviewed-by Eric BlakeWe deprecated "?" more than eight years ago. We didn't have a deprecation process back then, but we did purge "?" from the documentation and from help texts. Can we finally drop it?
I'm asking because there is a patch on the list that bypasses is_help_option() to not add deprecated "?" to a new place: "[PATCH v2 1/4] keyval: Parse help options".
commit c8057f951d64de93bfd01569c0a725baa9f94372
Author: Peter Maydell <[email protected]> Date: Thu Aug 2 13:45:54 2012 +0100
Support 'help' as a synonym for '?' in command line options
For command line options which permit '?' meaning 'please list the permitted values', add support for 'help' as a synonym, by abstracting the check out into a helper function.
This change means that in some cases where we were being lazy in our string parsing, "?junk" will now be rejected as an invalid option rather than being (undocumentedly) treated the same way as "?".
Update the documentation to use 'help' rather than '?', since '?' is a shell metacharacter and thus prone to fail confusingly if there is a single character filename in the current working directory and the '?' has not been escaped. It's therefore better to steer users towards 'help', though '?' is retained for backwards compatibility.
We do not, however, update the output of the system emulator's -help (or any documentation autogenerated from the qemu-options.hx which is the source of the -help text) because libvirt parses our -help output and will break. At a later date when QEMU provides a better interface so libvirt can avoid having to do this, we can update the -help text too.
commit 585f60368f23e6603cf86cfdaeceb89d1169f4b8
Author: Peter Maydell <[email protected]> Date: Thu Oct 4 16:22:01 2012 +0100
qemu-options.hx: Change from recommending '?' to 'help'
Update the -help output and documentation so that it recommends 'help' rather than '?' for the various "list valid values for this option" cases. '?' is deprecated (as it can fail confusingly if not quoted), so it's better to steer users towards 'help'. ('?' still works, for backwards compatibility.)
This is the -help option part of the change otherwise done in commit c8057f9, since we are now past release 1.2 and free to change our help text without worrying about breaking libvirt.
Quoted 3 lines · Markus Armbruster
We deprecated "?" more than eight years ago. We didn't have a deprecation process back then, but we did purge "?" from the documentation and from help texts. Can we finally drop it?
It's not mentioned in docs/system/deprecated.rst yet, so it is not officially deprecated yet. Provide a patch to add it to the list there, then you can remove it after two releases.
Thomas
Quoted 4 lines · Markus Armbruster
We deprecated "?" more than eight years ago. We didn't have a deprecation process back then, but we did purge "?" from the documentation and from help texts. Can we finally drop it?
Is it really that terrible a burden to support having an alias for 'help' ?
thanks
-- PMM
Quoted 8 lines · Peter Maydell
Quoted 4 lines · Markus Armbruster
We deprecated "?" more than eight years ago. We didn't have a deprecation process back then, but we did purge "?" from the documentation and from help texts. Can we finally drop it?
Is it really that terrible a burden to support having an alias for 'help' ?
I agree. Having the "?" is really convenient.
Am 01.10.2020 um 17:23 hat Christian Borntraeger geschrieben:
Quoted 13 lines · Peter Maydell
Quoted 8 lines · Markus Armbruster
Quoted 4 lines
We deprecated "?" more than eight years ago. We didn't have a deprecation process back then, but we did purge "?" from the documentation and from help texts. Can we finally drop it?
Is it really that terrible a burden to support having an alias for 'help' ?
I agree. Having the "?" is really convenient.
If people actually care about "?", can one of you send a patch to remove the comment that declares it deprecated?
Kevin
Quoted 8 lines · Markus Armbruster
We deprecated "?" more than eight years ago. We didn't have a deprecation process back then, but we did purge "?" from the documentation and from help texts. Can we finally drop it?
I'm asking because there is a patch on the list that bypasses
is_help_option()to not add deprecated "?" to a new place: "[PATCH v2 1/4] keyval: Parse help options".
Did we ever issue a warning when it was used? It's easier to argue that it can be dropped if users had notice of some form or another. That said, I'm not heartbroken if we yank it immediately instead of letting it live for 2 more releases.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Am 01.10.2020 um 15:06 hat Eric Blake geschrieben:
Quoted 10 lines · Markus Armbruster
Quoted 8 lines
We deprecated "?" more than eight years ago. We didn't have a deprecation process back then, but we did purge "?" from the documentation and from help texts. Can we finally drop it?
I'm asking because there is a patch on the list that bypasses
is_help_option()to not add deprecated "?" to a new place: "[PATCH v2 1/4] keyval: Parse help options".
Quoted 4 lines
Did we ever issue a warning when it was used? It's easier to argue that it can be dropped if users had notice of some form or another. That said, I'm not heartbroken if we yank it immediately instead of letting it live for 2 more releases.
A deprecation warning for a help option would somehow feel strange.
I would consider this a human-only interface that can be changed at will, like HMP syntax.
Kevin
Quoted 16 lines · Kevin Wolf
Am 01.10.2020 um 15:06 hat Eric Blake geschrieben:
Quoted 10 lines · Markus Armbruster
Quoted 8 lines
We deprecated "?" more than eight years ago. We didn't have a deprecation process back then, but we did purge "?" from the documentation and from help texts. Can we finally drop it?
I'm asking because there is a patch on the list that bypasses
is_help_option()to not add deprecated "?" to a new place: "[PATCH v2 1/4] keyval: Parse help options".Quoted 4 lines
Did we ever issue a warning when it was used? It's easier to argue that it can be dropped if users had notice of some form or another. That said, I'm not heartbroken if we yank it immediately instead of letting it live for 2 more releases.
Quoted 4 lines
A deprecation warning for a help option would somehow feel strange.
I would consider this a human-only interface that can be changed at will, like HMP syntax.
I'm not so sure ... for example we use "-device help" in the qemu-iotest scripts, so other people out there might use "-device ?" in their scripts, too, to check for the availability of devices... so IMHO we should follow the deprecation process properly here.
Thomas
Quoted 10 lines · Eric Blake
Quoted 8 lines · Markus Armbruster
We deprecated "?" more than eight years ago. We didn't have a deprecation process back then, but we did purge "?" from the documentation and from help texts. Can we finally drop it?
I'm asking because there is a patch on the list that bypasses
is_help_option()to not add deprecated "?" to a new place: "[PATCH v2 1/4] keyval: Parse help options".
Quoted 4 lines
Did we ever issue a warning when it was used? It's easier to argue that it can be dropped if users had notice of some form or another. That said, I'm not heartbroken if we yank it immediately instead of letting it live for 2 more releases.
How about keeping it as a convenience? I find it easier to type ? than help and often use it instead. It's sufficiently hidden to not cause any confusion for those who don't know and convenient for those who know. I agree with Peter that it should not be something that causes that much trouble that it would need to be removed immediately (or even in the future).
Regrads,
BALATON Zoltan
Hi,
Quoted 7 lines
Quoted 4 lines
Did we ever issue a warning when it was used? It's easier to argue that it can be dropped if users had notice of some form or another. That said, I'm not heartbroken if we yank it immediately instead of letting it live for 2 more releases.
How about keeping it as a convenience? I find it easier to type ? than help and often use it instead.
Well, ? has the problem that it is a shell glob char[1], which is for me enough reason to avoid it at least standalone ("-device ?"). When querying properties ("-device foo,?") it is much less likely to trip you up.
On the other hand I don't see any harm in keeping it. What would we save when we drop it? Given we already have a helper function to check it is only 2-3 lines of extra code I guess?
take care,
Gerd
[1] IIRC that was the reason to add "help" in the first place.