[Toybox] RFC: "ps -o ?", "logger -p ?", "kill -s ?"
enh
enh at google.com
Tue Feb 20 10:48:49 PST 2018
wasn't that the whole reason behind adding the suggestion to the
syntax error message?
ps: Missing argument to -o (see "ps --help")
i think the only real problem is the old bug where commands like top
don't show the -o/-O help from ps. (a quick workaround would be to
mention the "see also" in the top help.)
On Tue, Feb 20, 2018 at 10:43 AM, Rob Landley <rob at landley.net> wrote:
>
>
> On 02/20/2018 12:15 PM, Rob Landley wrote:
>> A lot of commands take a list of possible inputs to one of their options, and
>> there should be a way to query "what are the inputs". The way qemu does it is to
>> let you supply ? as the input (ala "qemu-system-i386 -M ?")
>>
>> The problem is ? is a shell wildcard so you have to quote it. Otherwise it works
>> _almost_ all the time, and then barfs if you have a single character filename in
>> your current directory because the shell swapped it out before running your command.
>>
>> Is there an obvious better api for this?
>>
>> Advantages of the qemu approach are A) a certain number of people out there are
>> already familiar with this, B) if you see "ps -o ?" even once it's pretty easy
>> to guess/remember what it does. Much more so than say "ps -o -". Disadvantage is
>> shell wildcard...
>>
>> Hmmm...
>
> Ah, qemu seems to have noticed the wildcard problem, and changed their
> recommendation:
>
> $ qemu-system-i386 -M x
> qemu-system-i386: -M x: unsupported machine type
> Use -machine help to list supported machines
>
> Ok, I suppose the magic name "help" is reasonable...?
>
> (I could also output the list for any unknown type, but there should be an error
> message at the top, and then it's not "for i in $(ps -o helo)"; do az $i; done"
> scriptable.)
>
> (One thing I've wondered about is where to _document_ this, and the error
> message telling you how to get help is the obvious place...)
>
> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
More information about the Toybox
mailing list