[issue546] Refactor out the command line parameter-processing
Tong Sun
bts at bts.grml.org
Tue Oct 7 16:44:57 CEST 2008
New submission from Tong Sun <suntong001 at gmail.com>:
Hi,
to log into bts what I intent to do...
[Comments from mika]:
> What would you think if we refactor out the command line
> parameter-processing into a separated file, say $PN.clp?
> If you are ok with it, I will take the response of building and
> maintaining the .clp/.hlp file. The only thing I need is the switch
> name (e.g, --boot=ldr) and switch description ("boot loader that
> ..."), and I'll take care of the rest. In fact, if you plan to build
> further scripts, I'll willing to take the response of building the
> .clp/.hlp files for them as well. . .
> With so many cmdline switches adding to grml-debootstrap, I think it
> is a good time to settle with it now than later. . .
> I know there are lots of technical details and concerns we need to
> settle first. Let's discuss them now. for example the .hlp file, we
> can make it a plain text file, so instead of sourcing it, why don't we
> change from
> usage() {
> echo "$PN - ...
> to
> usage() {
> cat "$PN".hlp
> more scripts if needed for providing any further help information
> }
> This shouldn't vary too much from the original design. If you still
> don't feel comfortable with it, we can do away with the .hlp file and
> maintain the help text just as before -- I'm open to any discussions.
I'm not comfortable with it because I don't see the big benefit from
it right now.
> > Putting
> > cmdline stuff into an extra file is a good idea but when doing so
> > I'd like to put some other stuff to separate files as well. :)
> let's take the command line parameter-processing as the first step,
> shall we? tackle one beast at a time, :-)
NACK for the usage stuff, but if *you* think that moving the cmdline
stuff into an external file is worth the effort: go for it and I'll
accept tested patches.
[Current status]
work started
[Concerns & issues]
- shall we settle the extension of the command line
parameter-processing separated file to .clp? that'll make my life a
bit easier since it will be consistent with my other scripts.
- on factoring out the command line parameter-processing, two more
dependents are required for grml-debootstrap: coreutils for readlink
and util-linux for getopt, thought it won't be a big deal since both
are essential packages available from debootstrap.
----------
messages: 1571
nosy: suntong
status: unread
title: Refactor out the command line parameter-processing
_____________________________________
GRML issue tracker <bts at bts.grml.org>
<http://bts.grml.org/grml/issue546>
_____________________________________
More information about the Bugs-changes
mailing list