summaryrefslogtreecommitdiff
path: root/scripts/library
AgeCommit message (Collapse)Author
2012-04-07Revert "parseopts: normalize options into an array"Dave Reisner
This was really only half a fix for FS#28445, as it still doesn't correctly handle the case of filenames with spaces. In the short term, there is no obvious fix for this. In the long term, I believe the correct decision is to rewrite the options parser to be more in line with GNU getopt_long. This reverts commits: ca4142714137b16feabac09c4cda86b0a75036f8. 969dcddbdf9d5dbd91aa414cdd193f3fb26b644b.
2012-04-07parse_options: initialize unused_options as arrayDave Reisner
Since we treat this as an array, we need to initialize it as one. This avoids addition of an empty element to the option string when we set the option array from the calling program, e.g. +/usr/bin/makepkg[2033]: set -- -i --pkg vim -- '' Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-16parseopts: normalize options into an arrayDave Reisner
Modify parse_options logic to fill an array instead of printing parsed options. Avoid eval like the plague. Because it is the plague. Fixes bugs such as FS#28445. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05parse_options: accept multiple argumentsAllan McRae
Allow command-line options to accept multiple arguments without additional quoting by taking the list of arguments until one starting with a "-" is reached. The only current use of this is the --pkg option in makepkg. This allows (e.g.) makepkg --pkg foo bar and packages "foo" and "bar" will be built. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05parse_options: implement optional argumentsAllan McRae
This allows options specified with a trailing "::" to optionally take arguments. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05parse_options: add missing newlinesAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24parse-options: simplify unused-arg & parameter printingDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-15parse_options: adjust error messagesAllan McRae
Provide consistent error messages for unknown long and short options. Also get full string translation for the messages. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15scripts/library: add README fileAllan McRae
Add a README file to briefly document the code snippets in the scripts library folder. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15scripts: refactor output formatting functionsAllan McRae
Move the common output formatting functions into a separate library file and import that into each script. makepkg is excluded due to its additional color formatting. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15makepkg: move option parsing code to separate fileAllan McRae
This move the getopt replacement function parse_options out of makepkg.sh.in and into a separate file. The code is inserted into the relevant place in makepkg using m4. This will allow the reuse of the option parsing code in other scripts (i.e. pacman-key) while avoiding code duplication. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>