File tree 1 file changed +15
-21
lines changed
1 file changed +15
-21
lines changed Original file line number Diff line number Diff line change 2
2
3
3
: " ${_config_names:= " fs_root zfs_root gateway syslogd pot_prefix fscomp_prefix" } "
4
4
5
+ # shellcheck disable=SC2039
5
6
config-help ()
6
7
{
7
8
echo ' pot config [-h][-v][-q] [-g name ]'
@@ -30,39 +31,32 @@ pot-config()
30
31
local _quiet
31
32
_quiet=" NO"
32
33
_get=
33
- if ! args=$( getopt hvqg: " $@ " ) ; then
34
- config-help
35
- ${EXIT} 1
36
- fi
37
- # shellcheck disable=SC2086
38
- set -- $args
39
- while true ; do
40
- case " $1 " in
41
- -h)
34
+ OPTIND=1
35
+
36
+ while getopts " hvqg:" _o ; do
37
+ case " $_o " in
38
+ h)
42
39
config-help
43
40
${EXIT} 0
44
41
;;
45
- - v)
42
+ v)
46
43
_POT_VERBOSITY=$(( _POT_VERBOSITY + 1 ))
47
- shift
48
44
;;
49
- - q)
45
+ q)
50
46
_quiet=" quiet"
51
- shift
52
47
;;
53
- - g)
54
- if _is_in_list " $2 " " $_config_names " ; then
55
- _get=" $2 "
48
+ g)
49
+ if _is_in_list " $OPTARG " " $_config_names " ; then
50
+ _get=" $OPTARG "
56
51
else
57
- _qerror $_quiet " $2 is not a valid name"
52
+ _qerror $_quiet " $OPTARG is not a valid name"
58
53
[ " quiet" != " $_quiet " ] && config-help
59
54
${EXIT} 1
60
55
fi
61
- shift 2
62
56
;;
63
- -- )
64
- shift
65
- break
57
+ * )
58
+ config-help
59
+ ${EXIT} 1
66
60
;;
67
61
esac
68
62
done
You can’t perform that action at this time.
0 commit comments