Hi All,
I'm pretty sure there is a standard way to deal with switches on command line arguments. What I'm looking for, is a general program bloc where arguments and options are parsed, knowing that options can be passed to program in any order. Eg: if I have got a program called myscript, supporting to options filename (-f) and mode (-m) and one argument arg1, user may call this program by severak ways :
or at least, user can use options in any order, but cannot used the condensed way (-fm).
Thanks,
Zephan
I'm pretty sure there is a standard way to deal with switches on command line arguments. What I'm looking for, is a general program bloc where arguments and options are parsed, knowing that options can be passed to program in any order. Eg: if I have got a program called myscript, supporting to options filename (-f) and mode (-m) and one argument arg1, user may call this program by severak ways :
Code:
myscript -fm filename mode arg1 ;
myscript -m -f mode filename arg1 ;
etc...
Thanks,
Zephan