2009年5月22日

Using shflags in bash shell script to get long and short command line options

shflags
Download and extract shflags and run example hello_world.sh

# wget http://shflags.googlecode.com/files/shflags-1.0.3.tgz
# tar zxvf shflags-1.0.3.tgz
# cd shflags-1.0.3/examples/
# ./hello_world.sh --help
USAGE: ./hello_world.sh [flags] args
flags:
-n,--name: name to say hello to (default: 'world')
-h,--[no]help: show this help (default: false)
# ./hello_world.sh --name Solnone
Hello, Solnone!

沒有留言:

網誌存檔