palaniyappanBala / klish

Automatically exported from code.google.com/p/klish
Other
0 stars 0 forks source link

RFE] Unordered mandatory arguments #135

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

I have a use case where I would like to be able to define non optional and 
unordered arguments. My commands accept parameters in any order and I can tell 
which one are optional and which one are not.

Ideally, this would be defined with the following config:
                <PARAM name="-c"
                        help="-c"
                        ptype="SUBCOMMAND"
                        mode="subcommand"
                        order=”false”
                        optional="false">

                        <PARAM name="p_int"
                                help="optional uint param"
                                ptype="UINT"/>

                </PARAM>

I was looking at the files (klish-1.6.6/clish/shell/shell_parse.c:238) and 
get_order is only used when a parameter is optional.

I am currently looking at the code to understand how the index and nopt_param 
and nopt_index works, but I would love to have so guidance from you guys!

Thanks!

Klish v1.6.6, Debian Linux

Original issue reported on code.google.com by corent...@gmail.com on 10 Oct 2013 at 10:25