X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=py-compile;h=6916903742e6403d22452f0d0781d89827c0e8b5;hb=a82f6d58d311ba9fe9a4cf273b9aa3ff2aed77ca;hp=3f9d05b603db603f16721a91bb729571d2dbb5de;hpb=72889efeefc056f1cc0633575d544735886c91ca;p=platform%2Fupstream%2Flibical.git diff --git a/py-compile b/py-compile index 3f9d05b..6916903 100755 --- a/py-compile +++ b/py-compile @@ -1,10 +1,9 @@ #!/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-2012 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 +31,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 +76,27 @@ Report bugs to . 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