From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9C8D6198005 for ; Mon, 11 Mar 2013 10:15:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2FC48E05DD; Mon, 11 Mar 2013 10:15:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BAB94E05DD for ; Mon, 11 Mar 2013 10:15:09 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D50EA33D884 for ; Mon, 11 Mar 2013 10:15:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 7491DE4079 for ; Mon, 11 Mar 2013 10:15:07 +0000 (UTC) From: "Ulrich Mueller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Mueller" Message-ID: <1362997171.34f588cff4c96b761e4a5889c15cfa0cbc443829.ulm@gentoo> Subject: [gentoo-commits] proj/emacs-tools:emacs-updater commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: ChangeLog emacs-updater X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Mueller X-VCS-Revision: 34f588cff4c96b761e4a5889c15cfa0cbc443829 X-VCS-Branch: emacs-updater Date: Mon, 11 Mar 2013 10:15:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 07cb6567-a671-4379-a254-1572488b1a40 X-Archives-Hash: 8b7739b18eac2fd7b98ce0b47494a4ed commit: 34f588cff4c96b761e4a5889c15cfa0cbc443829 Author: Ulrich Müller gentoo org> AuthorDate: Mon Mar 11 10:19:31 2013 +0000 Commit: Ulrich Mueller gentoo org> CommitDate: Mon Mar 11 10:19:31 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=34f588cf Add sanity check for package manager options. * emacs-updater: Add sanity check for package manager options. --- ChangeLog | 2 ++ emacs-updater | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed45772..5975a1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2013-03-11 Ulrich Müller + * emacs-updater: Add sanity check for package manager options. + * emacs-updater (OPTIONS): Make argument of the --colour option optional, for compatibility with ls. (usage): Update help text. diff --git a/emacs-updater b/emacs-updater index fe9e532..d177f31 100755 --- a/emacs-updater +++ b/emacs-updater @@ -170,7 +170,16 @@ do shift 2 ;; --package-manager-command) PM_COMMAND=$2; shift 2 ;; - --) shift; PM_EXTRAOPTS=( "$@" ); break ;; + --) + shift + if [[ $# -gt 0 && ${1#-} = $1 ]]; then + # first parameter after -- should be an option + echo "Non-option parameter '$1' for package manager specified!" + usage 22 + fi + PM_EXTRAOPTS=( "$@" ) + break + ;; *) # this should not happen; getopt should return bad status echo "Invalid option '$1' given!"