From: "Sebastian Pipping" <sping@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/emacs-tools:backups/emacs-updater@1030 commit in: /
Date: Sun, 6 May 2012 16:07:19 +0000 (UTC) [thread overview]
Message-ID: <1204318323.b0b77d9b213efe47f047485fc25f7a7658eef657.sping@gentoo> (raw)
commit: b0b77d9b213efe47f047485fc25f7a7658eef657
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 29 20:52:03 2008 +0000
Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Feb 29 20:52:03 2008 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=b0b77d9b
Check for getopt exit status. Add usage function.
svn path=/emacs-extra/emacs-updater/; revision=984
---
ChangeLog | 4 ++++
emacs-updater | 21 ++++++++++++++++-----
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2f82317..ebe9839 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-29 Ulrich Mueller <ulm@gentoo.org>
+
+ * emacs-updater: Check for getopt exit status. Add usage function.
+
2008-02-25 Christian Faulhammer <opfer@gentoo.org>
* emacs-updater: Number of packages that need a remerge is
diff --git a/emacs-updater b/emacs-updater
index d905e20..b22e46b 100755
--- a/emacs-updater
+++ b/emacs-updater
@@ -8,7 +8,7 @@
# Christian Faulhammer <opfer@gentoo.org>
# Ulrich Mueller <ulm@gentoo.org>
-VERSION=0.5.1
+VERSION=0.6
SITELISP=/usr/share/emacs/site-lisp
TMPFILE="$(mktemp /tmp/emacs-updater.XXXXXX)"
@@ -20,19 +20,30 @@ Find packages that are installed in the wrong location
EOF
+usage() {
+ sed -e 's/^X//' <<-EOF
+ Usage: ${0##*/} [OPTION]...
+ X -n, --nocolour disable colour in output
+ X -p, --pretend don't actually emerge packages
+ X -h, --help display this help and exit
+ EOF
+ exit $1
+}
+
# Read in all command-line options and force English output
OPTIONS=$(LC_ALL=C getopt -o hpn --long help,pretend,nocolour \
-n 'emacs-updater' -- "$@")
+[ $? -eq 0 ] || usage 1
eval set -- "${OPTIONS}"
while true
do
case "${1}" in
- -h|--help) echo "You have the following options: --pretend|-p and/or --no-colour|-n" ; exit 0 ;;
- -p|--pretend) PRETEND="true"; shift 1 ;;
- -n|--nocolour) NOCOLOUR="true"; shift 1;;
- --) shift ; break ;;
+ -h|--help) usage 0 ;;
+ -p|--pretend) PRETEND="true"; shift 1 ;;
+ -n|--nocolour) NOCOLOUR="true"; shift 1 ;;
+ --) shift; break ;;
esac
done
next reply other threads:[~2012-05-06 16:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-06 16:07 Sebastian Pipping [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-05-06 16:07 [gentoo-commits] proj/emacs-tools:backups/emacs-updater@1030 commit in: / Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
2012-05-06 16:07 Sebastian Pipping
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1204318323.b0b77d9b213efe47f047485fc25f7a7658eef657.sping@gentoo \
--to=sping@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox