[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: argmatch: accept perfect matches in documented arglists
From: |
Akim Demaille |
Subject: |
Re: argmatch: accept perfect matches in documented arglists |
Date: |
Sat, 27 Apr 2019 18:36:31 +0200 |
> Le 27 avr. 2019 à 14:33, Bruno Haible <address@hidden> a écrit :
>
> Hi Akim,
Hi Bruno,
> Sorry but I don't understand this:
>
>> $ bison --trace=help
>> bison: invalid argument ‘help’ for ‘--trace’
>> Valid arguments are:
>> - ‘none - no traces’
>> - ‘scan - grammar scanner traces’
>> - ‘parse - grammar parser traces’
>> - ‘parse-stats - grammar parser stats’
>> - ‘automaton - construction of the automaton’
>> - ‘bitsets - use of bitsets’
>> - ‘closure - input/output of closure’
>> - ‘grammar - reading, reducing the grammar’
>> - ‘resource - memory consumption (where available)’
>> - ‘sets - grammar sets: firsts, nullable etc.’
>> - ‘muscles - m4 definitions passed to the skeleton’
>> - ‘tools - m4 invocation’
>> - ‘m4 - m4 traces’
>> - ‘skeleton - skeleton postprocessing’
>> - ‘time - time consumption’
>> - ‘ielr - IELR conversion’
>> - ‘all - all of the above’
>
> Why not:
>
> $ bison --trace=help
> bison: invalid argument ‘help’ for ‘--trace’
> Valid arguments are:
> - ‘none’ - no traces
> - ‘scan’ - grammar scanner traces
> - ‘parse’ - grammar parser traces
> - ‘parse-stats’ - grammar parser stats
> - ‘automaton’ - construction of the automaton
> - ‘bitsets’ - use of bitsets
> - ‘closure’ - input/output of closure
> - ‘grammar’ - reading, reducing the grammar
> - ‘resource’ - memory consumption (where available)
> - ‘sets’ - grammar sets: firsts, nullable etc.
> - ‘muscles’ - m4 definitions passed to the skeleton
> - ‘tools’ - m4 invocation
> - ‘m4’ - m4 traces
> - ‘skeleton’ - skeleton postprocessing
> - ‘time’ - time consumption
> - ‘ielr’ - IELR conversion
> - ‘all’ - all of the above
Because that's not what argmatch provides. You seem to be referring to
a fully blown feature, and support for internationalization I guess.
I'm just exploiting the unique prefix feature to shoehorn the
documentation in there.
>> + Accept arguments with a documentation string, such as:
>> + "foo - a first feature" -> 0
>> + "bar - a second feature" -> 1
>
> It doesn't make sense to me to expect that the user will type
> bison --trace='none - no traces'
> when they can type
> bison --trace=none
Yes, of course not. No one would ever do that. Then again, this
option is not even documented.