Carey Evans wrote:
> 
> "Jason M. Felice" <[EMAIL PROTECTED]> writes:
> 
> > I tried to make the syntax as similar to GNU-style long options as
> > possible.  The problem is that the option needs to indicate whether or
> > not it has an argument, as the 5250 emulator may not understand the
> > option and have to pass it to one of the other modular pieces, like
> > the terminal driver or the stream driver.
> 
> I thought about this a bit, and came up with two solutions which would
> work for using long options.
> 
> The more complicated one is to add functions to conf.c to let the
> different tn5250 modules declare the types of options they accept;
> e.g. cursesterm has a boolean "underscores" option, and telnetstream
> has a dictionary option "env".  This would let it parse the arguments
> as GNU long options, and also check the configuration file for invalid
> options.
> 
> A simpler one would be to make each main program accept a fixed set of
> GNU long options, and use getopt_long to parse them.  Then these
> options would be mapped to the configuration file options.  Arbitrary
> options could still be passed as NAME=VALUE, or perhaps with a
> different argument.
> 
> For example, this would let the user do something like:
> 
>     tn5250 -s SESS1 --map=280 -o 'env.IBMIMENU=MAIN' as400sys
> 
> The latter solution shouldn't be very difficult to implement.
> 

This all sounds like -lpopt command-line parsing.  You can use an
external configuration file when parsing options with `-lpopt' to make
an option alias.
If we ever get to loadable modules (which is a good thing IMHO - right
now gnome-5250 loads -lncurses, for example), the module's install
script can tweak the popt config file accordingly.

RedHat's RPM does just this.  rpm -qi (for example) is just an alias for
rpm --queryformat "%{ <the format of the info output> }"

I'd like to hear from the BSD people as to whether -lpopt is installed
on their system (Scott?).  It's a really portable library.


-Jay 'Eraserhead' Felice
+---
| This is the LINUX5250 Mailing List!
| To submit a new message, send your mail to [EMAIL PROTECTED]
| To subscribe to this list send email to [EMAIL PROTECTED]
| To unsubscribe from this list send email to [EMAIL PROTECTED]
| Questions should be directed to the list owner/operator: [EMAIL PROTECTED]
+---

Reply via email to