diff options
author | Ted Gould <ted@gould.cx> | 2012-03-09 12:08:33 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-03-09 12:08:33 -0600 |
commit | b681b75cecff5f916350c6340c137a7c99e7a0c6 (patch) | |
tree | 4e15e06c2b7e2884a16f51fb76066a43d28a19ae /py-compile | |
parent | 7256c1864e94cf172a4c487a5f434e58f6f71666 (diff) | |
parent | f95bf78035fd4e550a67b74e902c0c2ba7df15bc (diff) | |
download | libayatana-appindicator-b681b75cecff5f916350c6340c137a7c99e7a0c6.tar.gz libayatana-appindicator-b681b75cecff5f916350c6340c137a7c99e7a0c6.tar.bz2 libayatana-appindicator-b681b75cecff5f916350c6340c137a7c99e7a0c6.zip |
Import upstream version 0.4.91
Diffstat (limited to 'py-compile')
-rwxr-xr-x | py-compile | 51 |
1 files changed, 33 insertions, 18 deletions
@@ -1,10 +1,10 @@ #!/bin/sh # py-compile - Compile a Python program -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-06-08.12; # UTC -# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009 Free Software -# Foundation, Inc. +# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009, 2011 Free +# Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,28 +32,36 @@ if [ -z "$PYTHON" ]; then PYTHON=python fi +me=py-compile + +usage_error () +{ + echo "$me: $*" >&2 + echo "Try \`$me --help' for more information." >&2 + exit 1 +} + basedir= destdir= -files= while test $# -ne 0; do case "$1" in --basedir) - basedir=$2 - if test -z "$basedir"; then - echo "$0: Missing argument to --basedir." 1>&2 - exit 1 + if test $# -lt 2; then + usage_error "option '--basedir' requires an argument" + else + basedir=$2 fi shift ;; --destdir) - destdir=$2 - if test -z "$destdir"; then - echo "$0: Missing argument to --destdir." 1>&2 - exit 1 + if test $# -lt 2; then + usage_error "option '--destdir' requires an argument" + else + destdir=$2 fi shift ;; - -h|--h*) + -h|--help) cat <<\EOF Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..." @@ -69,20 +77,27 @@ Report bugs to <bug-automake@gnu.org>. EOF exit $? ;; - -v|--v*) - echo "py-compile $scriptversion" + -v|--version) + echo "$me $scriptversion" exit $? ;; + --) + shift + break + ;; + -*) + usage_error "unrecognized option '$1'" + ;; *) - files="$files $1" + break ;; esac shift done +files=$* if test -z "$files"; then - echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 - exit 1 + usage_error "no files given" fi # if basedir was given, then it should be prepended to filenames before |