[pacman-dev] [PATCH] Fix command line argument parsing in makepkg

Xavier shiningxc at gmail.com
Thu May 22 14:34:22 EDT 2008

Aaron Griffin wrote:
> I've been following this thread only peripherally. But my opinion is this:
> getopt/getopts in bash is very confusing and annoying. Useful for only
> shortopts, but once you introduce long options, it gets annoying. In
> all seriousness, it might be easier just to switch to manual parsing
> and eschew getopt/getopts altogether. I mean, all our options only
> take one arg, right? So parsing should be fairly simply, I'd think

If we are considering to do this manually, I would rather re-use at 
least getops, that is switch back to the old way, which was like 
semi-manual :)

I found an alternative getopt function which might solve our problems, 
but I am not sure we want to explicitly have all this complexity :

My second favorite way would be to kill all long options. The problem is 
that there are some long only option :
       --asroot     Allow makepkg to run as root user
       --holdver    Prevent automatic version bumping for development 
       --source     Do not build package; generate a source-only tarball
       --noconfirm      Do not ask for confirmation when resolving 
       --noprogressbar  Do not show a progress bar when downloading files

So for each of these option, we can either :
1) find a decent short option to rename it
2) kill it totally
3) find a replacement, for example a setting in makepkg.conf

What do you think?

More information about the pacman-dev mailing list