comparison bin/fjail @ 81:124faa20ae80

Implemented a "-V" global option to print the program's name and version number to stdout
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 16 Aug 2019 09:16:27 +0200
parents f5cf08e8d246
children 56dd768b5fdd
comparison
equal deleted inserted replaced
80:f5cf08e8d246 81:124faa20ae80
8 8
9 USAGE=" 9 USAGE="
10 USAGE: fjail [ OPTIONS ] COMMAND [ COMMAND OPTIONS ] [ ARG ... ] 10 USAGE: fjail [ OPTIONS ] COMMAND [ COMMAND OPTIONS ] [ ARG ... ]
11 11
12 OPTIONS: 12 OPTIONS:
13
14 -V Print the program name and version number to stdout and exit
13 15
14 -h Print this help message to stdout and exit 16 -h Print this help message to stdout and exit
15 17
16 COMMANDS: 18 COMMANDS:
17 19
228 230
229 231
230 # 232 #
231 # Global option handling 233 # Global option handling
232 # 234 #
233 while getopts "h" _opt ; do 235 while getopts "Vh" _opt ; do
234 case ${_opt} in 236 case ${_opt} in
237 V)
238 echo "fjail v${VERSION} (rv:@@HGREVISION@@)"
239 exit 0
240 ;;
235 h) 241 h)
236 echo "${USAGE}" 242 echo "${USAGE}"
237 exit 0 243 exit 0
238 ;; 244 ;;
239 \?) 245 \?)