pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/bootstrap bootstrap/bootstrap: detect unknown options ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f8dc71c6b344
branches:  trunk
changeset: 325196:f8dc71c6b344
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Nov 11 19:31:54 2018 +0000

description:
bootstrap/bootstrap: detect unknown options and print usage

Running bootstrap with short options (like -q for --quiet) is not
implemented. Therefore, instead of silently ignoring such options, fail
with an appropriate error message.

diffstat:

 bootstrap/bootstrap |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 53394a32305d -r f8dc71c6b344 bootstrap/bootstrap
--- a/bootstrap/bootstrap       Sun Nov 11 19:07:12 2018 +0000
+++ b/bootstrap/bootstrap       Sun Nov 11 19:31:54 2018 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.258 2018/11/09 13:37:09 jperkin Exp $
+# $NetBSD: bootstrap,v 1.259 2018/11/11 19:31:54 rillig Exp $
 #
 # Copyright (c) 2001-2011 Alistair Crooks <agc%NetBSD.org@localhost>
 # All rights reserved.
@@ -463,7 +463,8 @@
        --quiet)        quiet=yes ;;
        --help)         echo "$usage"; exit ;;
        -h)             echo "$usage"; exit ;;
-       --*)            echo "$usage"; exit 1 ;;
+       -*)             echo "${0##*/}: unknown option \"$1\"" 1>&2
+                       echo "$usage" 1>&2; exit 1 ;;
        esac
        shift
 done



Home | Main Index | Thread Index | Old Index