Hello Gary...
Thanks for the quick reply.
I am creating a new Red_Boot command which should look like this:
create_stuff -a AAA -b BBB -c CCC
where: AAA is the first parameter, BBB second and CCC third.
The point is that -b and -c parameters are not mandatory, I mean, the user may enter:
create_stuff -a AAA
Currently, if I use the last command I get the error!
This is part of my code:
init_opts(&opts[0], 'a', true, 1, (void **)¶mA, (bool *)&bparamA, "<a> - A Parameter");
init_opts(&opts[1], 'b', true, 1, (void **)¶mB, (bool *)&bparamB, "<b> - B Parameter");
init_opts(&opts[2], 'c', true, 1, (void **)¶mC, (bool *)&bparamC, "<c> - C Parameter");
if (!scan_opts(argcent, argvent, 1, opts, num_opts, (void **)0, 0, ""))
{
(void)diag_printf("ERROR - Invalid option specified\n");
return;
}
Please, let me know if I confused you anymore.
Thanks again.
Douglas
----- Mensagem original ----
De: Gary Thomas <gary@mlbassoc.com>
Para: Temp Account <dlpguard2000-spam@yahoo.com.br>
Cc: ecos-discuss@ecos.sourceware.org
Enviadas: Segunda-feira, 27 de Novembro de 2006 10:13:51
Assunto: Re: [ECOS] The init_opts method
Temp Account wrote:
Is it possible to have an optional parameter?
What is the bool takes_arg purpose?
thnks,
Douglas
Perhaps you can explain your questions in more detail?
Give examples of what you'd like explained.