You might be interested in argp (part of glibc and gnulib) which does more or less what you wish to achive, without the need for initial parsing.
_______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils