optparse

rick rickzolun1 at bellsouth.net
Wed Sep 27 11:40:40 EDT 2006


OK, using that convention, how would I create help for <arg1>, <arg2>, etc.

Thanks.

On 9/27/2006 12:44 AM, Ben Finney wrote:
> rick <rickzolun1 at charter.net> writes:
> 
>> usage: DelimTOFixedWidth.py <input filename> <output filename> [options]
> 
> That's not the command-line argument style that optparse models. It
> should be:
> 
>     command_name [options] <arg1> <arg2>
> 
> In other words, the options (optionally) appear before the non-option
> arguments. This is the convention followed by most command-line tools,
> and it's what users expect.
> 
> There are other command-line parser modules (e.g. argparse), perhaps
> you can look to them for different functionality.
> 



More information about the Python-list mailing list