public inbox for gnats-prs@sourceware.org
help / color / mirror / Atom feed
From: Jason Molenda <jsm@cygnus.com>
To: nobody@sourceware.cygnus.com
Cc: gnats-prs@sourceware.cygnus.com
Subject: Re: gnats/6: at-pr argument counting mangled
Date: Mon, 25 Oct 1999 19:04:00 -0000	[thread overview]
Message-ID: <19991026020400.23575.qmail@sourceware.cygnus.com> (raw)

The following reply was made to PR gnats/6; it has been noted by GNATS.

From: Jason Molenda <jsm@cygnus.com>
To: m.seaman@inpharmatica.co.uk
Cc: gnats-gnats@sourceware.cygnus.com
Subject: Re: gnats/6: at-pr argument counting mangled
Date: Mon, 25 Oct 1999 18:55:37 -0700

 Thanks for the PR and the patch.  Your patch would not work for someone
 passing the -h command line parameter to at-pr.sh.  
 
 Can you please try out the appended patch at your site and let me know if
 it works as expected?  I ran through a few tests by hand, but I don't use
 timed notification locally.  I'd like to have this tested out somewhere
 else before I commit it to the master gnats sources.
 
 Thanks!
 
 Jason
 
 Index: at-pr.sh
 ===================================================================
 RCS file: /cvs/gnats/gnats/gnats/at-pr.sh,v
 retrieving revision 1.1.1.1
 diff -u -p -r1.1.1.1 at-pr.sh
 --- at-pr.sh	1998/11/05 19:54:09	1.1.1.1
 +++ at-pr.sh	1999/10/26 01:52:59
 @@ -20,7 +20,7 @@
  # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  
  prog=`basename $0`
 -USAGE="$prog: [-h] [-d gnats_root]  arguments
 +USAGE="Usage: $prog [-h] [-d gnats_root] arguments
  
   Arguments coming in are (all are required):
  
 @@ -31,20 +31,37 @@ USAGE="$prog: [-h] [-d gnats_root]  argu
   5 - full name of the submitter
   6 - contact for the submitter
   7 - address for GNATS_ADMIN
 -
  "
  
  PATH=/bin:/usr/bin; export PATH
  
 +if [ $# -eq 0 ]
 +then
 +  echo "$USAGE" >&2
 +  exit 1
 +fi
 +
 +if [ "$1" = "-h" -o "$1" = "--help" ]
 +then
 +  echo "$USAGE"
 +  exit 0
 +fi
 +
  # process command line options
 -while [ $# -gt 0 ]; do
 +while [ $# -gt 7 ]; do
    case "$1" in
      -d | --directory)
 -      if [ $# -eq 1 ]; then echo "value required for $1 option"; exit 1; fi
 -      shift ; GNATS_ROOT="$1" ;;
 +      if [ $# -eq 8 ]
 +      then 
 +        echo "ERROR: value required for $1 option" >&2
 +        echo "$USAGE" >&2
 +        exit 1
 +      fi
 +      shift 
 +      GNATS_ROOT="$1" ;;
      --directory=*) GNATS_ROOT="`echo $1 | sed 's/^[-a-z]*=//'`" ;;
  
 -    -*) echo "$USAGE"; exit 1 ;;
 +    -*) echo "$USAGE" >&2; exit 1 ;;
    esac
    shift
  done
 @@ -61,14 +78,14 @@ STATES_FILE=${GNATS_ROOT}/gnats-adm/stat
  [ -f ${GNATS_ROOT}/gnats-adm/config ] && . ${GNATS_ROOT}/gnats-adm/config
  
  if [ $# != 7 ]; then
 -  echo "$prog: called with the incorrect number of arguments"
 -  echo "$USAGE"
 +  echo "ERROR: $prog called with the incorrect number of arguments" >&2
 +  echo "$USAGE" >&2
    exit 1
  fi
   
  if [ ! -d $GNATS_ROOT ]; then
 -  echo "$prog: GNATS base directory $GNATS_ROOT does not exist."
 -  echo "$USAGE"
 +  echo "ERROR: $prog GNATS base directory $GNATS_ROOT does not exist." >&2
 +  echo "$USAGE" >&2
    exit 1
  fi
  


             reply	other threads:[~1999-10-25 19:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-25 19:04 Jason Molenda [this message]
1999-10-26  1:44 Jason Molenda
1999-10-27 13:04 Jason Molenda

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=19991026020400.23575.qmail@sourceware.cygnus.com \
    --to=jsm@cygnus.com \
    --cc=gnats-prs@sourceware.cygnus.com \
    --cc=nobody@sourceware.cygnus.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).