avrdude-dev
[Top][All Lists]
Advanced

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

Re: [avrdude-dev] New option-parsing


From: Brian Dean
Subject: Re: [avrdude-dev] New option-parsing
Date: Mon, 9 Feb 2004 16:09:02 -0500
User-agent: Mutt/1.5.5.1i

On Sun, Feb 08, 2004 at 11:55:09PM +0100, Jan-Hinnerk Reichert wrote:

> 2) Pass the options to the programmer one at a time. To do this we 
> have to get an option-description first. So, we need another function 
> in pgm-struct. We should also add a function for checking consistency 
> after all options are through. So we get alot new stuff in the 
> pgm-struct.

This seems reasonable.  Are you thinking of something like this in main():

        while ((ch = getopt(...)) != -1) {
          switch (ch) {

            ...

            default:
              if (pgm) {
                rc = pgm->option(ch, optarg);
                if (rc < 0) {
                  /* invalid option */
                }
              }
              else {
                /* invalid option or programmer not yet specified */
              }
              break;
          }
        }

Or something similar?  One affect this has is that option letters for
one programmer map (or should map) to the equivalent function for
other programmers.  For example, it would be bad to make '-k' do one
thing on one programmer but do something else for another programmer.

> However, there is no need to define any functions for programmers that 
> don't support special options, no matter how we implement this.
> 
> Any comments on this?
> 
> BTW: Are there plans to remove the deprecated options any time soon? 
> Would make some nice cleanup in main...

We should probably do that before the next release.  IIRC, we've done
one complete release cycle with the depricated options still present,
so it should be reasonable to remove them now.  It's on my list but if
you want to do it sooner that I get to it, please feel free.

-Brian




reply via email to

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