[dev] Re: [dev] Re: [dev] Re: [dev] Re: [dev] [dev] Usage, -h, --help, help, synopsis, …

From: yy <yiyu.jgl_AT_gmail.com>
Date: Sat, 21 Aug 2010 22:14:41 +0200

2010/8/21 Suraj Kurapati <sunaku_AT_gmail.com>:
> I like to put documentation at the head of a file because that's only
> part anyone will read before deciding if it's worth spending their
> time to delve into the rest of the shell script.  Also, I don't like
> messing up my program's indentation because I have to emit a big block
> of text in it:

#!/bin/sh

USAGE="\
Usage: $0 -flags args
Explain the options here.
You even can even use use shell variables!
"

if [ $# -lt 1]; then
    echo -n "$USAGE" 1>&2
    exit 1
fi

Is this really so ugly?

-- 
- yiyus || JGL . 4l77.com
Received on Sat Aug 21 2010 - 22:14:41 CEST

This archive was generated by hypermail 2.2.0 : Sat Aug 21 2010 - 22:24:02 CEST