pupa-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Argument parser


From: Yoshinori K. Okuji
Subject: Re: Argument parser
Date: Mon, 15 Dec 2003 23:29:57 +0100
User-agent: KMail/1.5

On Monday 15 December 2003 22:51, Marco Gerards wrote:
> Not always.  In your example the arguments (short, long and other)
> age mixed up.  In that case you cannot use an array.

I mixed up them intentionally, because you said that the GNU way was 
easy to implement. I showed a simple example that the GNU way was not 
easy actually.

If you follow the GNU way, your parser or the implementation of a 
command function must be complex. If you make your parser easier, the 
burden would just move to one who uses your parser.

> Of course it is easy to make an array of the arguments that are not a
> short/long option.  This array can be passed to the command as
> well. So a command can look like this:
>
> int pupa_cmd_ls (..., char *args[]);

That's right. That's the very thing I wanted to mean.

I still think it would be better to use the POSIX way than the GNU way, 
to make everything easier and simpler. As most people don't use a boot 
loader interactively frequently, this should be a good decision.

Okuji




reply via email to

[Prev in Thread] Current Thread [Next in Thread]