File tree 4 files changed +27
-9
lines changed
4 files changed +27
-9
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
16
16
- info: -s to list available snapshots of a pot
17
17
- clone: -s flag to explicitly choose the snapshot to clone
18
18
- architecture: remove limitation of amd64 as the only architecture supported (#143 by jmg@)
19
+ - start/stop/term/run: add support to -p potname on those commands, the only one not supporting it
19
20
20
21
### Changed
21
22
- hostname: max default length for hostname set to 64 (#118 )
Original file line number Diff line number Diff line change 3
3
# shellcheck disable=SC3033
4
4
start-help ()
5
5
{
6
- echo " pot start [-h] [potname] "
6
+ echo " pot start [-h] [-p] potname "
7
7
echo ' -h print this help'
8
8
echo ' -v verbose'
9
9
echo ' -s take a snapshot before to start'
@@ -562,8 +562,9 @@ pot-start()
562
562
# shellcheck disable=SC3043
563
563
local _pname _snap
564
564
_snap=none
565
+ _pname=
565
566
OPTIND=1
566
- while getopts " hvsS " _o ; do
567
+ while getopts " hvsSp: " _o ; do
567
568
case " $_o " in
568
569
h)
569
570
start-help
@@ -578,13 +579,18 @@ pot-start()
578
579
S)
579
580
_snap=full
580
581
;;
582
+ p)
583
+ _pname=" $OPTARG "
584
+ ;;
581
585
* )
582
586
start-help
583
587
${EXIT} 1
584
588
;;
585
589
esac
586
590
done
587
- _pname=" $( eval echo \$ $OPTIND ) "
591
+ if [ -z " $_pname " ]; then
592
+ _pname=" $( eval echo \$ $OPTIND ) "
593
+ fi
588
594
if [ -z " $_pname " ]; then
589
595
_error " A pot name is mandatory"
590
596
start-help
Original file line number Diff line number Diff line change 3
3
# shellcheck disable=SC3033
4
4
stop-help ()
5
5
{
6
- echo " pot stop [-hv] [potname] "
6
+ echo " pot stop [-hv] [-p] potname "
7
7
echo ' -h print this help'
8
8
echo ' -v verbose'
9
9
echo ' potname : the pot that has to stop'
@@ -147,9 +147,10 @@ pot-stop()
147
147
{
148
148
# shellcheck disable=SC3043
149
149
local _pname
150
+ _pname=
150
151
151
152
OPTIND=1
152
- while getopts " hv " _o; do
153
+ while getopts " hvp: " _o; do
153
154
case " $_o " in
154
155
h)
155
156
stop-help
@@ -158,13 +159,18 @@ pot-stop()
158
159
v)
159
160
_POT_VERBOSITY=$(( _POT_VERBOSITY + 1 ))
160
161
;;
162
+ p)
163
+ _pname=" $OPTARG "
164
+ ;;
161
165
? )
162
166
stop-help
163
167
${EXIT} 1
164
168
;;
165
169
esac
166
170
done
167
- _pname=" $( eval echo \$ $OPTIND ) "
171
+ if [ -z " $_pname " ]; then
172
+ _pname=" $( eval echo \$ $OPTIND ) "
173
+ fi
168
174
if [ -z " $_pname " ]; then
169
175
_error " A pot name is mandatory"
170
176
stop-help
Original file line number Diff line number Diff line change 4
4
# shellcheck disable=3033
5
5
term-help ()
6
6
{
7
- echo " pot term [-h ] [potname] "
7
+ echo " pot term [-hvf ] [-p] potname "
8
8
echo ' -h print this help'
9
9
echo ' -v verbose'
10
10
echo ' -f force: it start the pot, if it' \' ' s not running'
@@ -32,7 +32,7 @@ pot-term()
32
32
_force=
33
33
34
34
OPTIND=1
35
- while getopts " hvf " _o; do
35
+ while getopts " hvfp: " _o; do
36
36
case " $_o " in
37
37
h)
38
38
term-help
@@ -44,12 +44,17 @@ pot-term()
44
44
f)
45
45
_force=" YES"
46
46
;;
47
+ p)
48
+ _pname=" $OPTARG "
49
+ ;;
47
50
? )
48
51
break
49
52
;;
50
53
esac
51
54
done
52
- _pname=" $( eval echo \$ $OPTIND ) "
55
+ if [ -z " $_pname " ]; then
56
+ _pname=" $( eval echo \$ $OPTIND ) "
57
+ fi
53
58
if [ -z " $_pname " ]; then
54
59
_error " A pot name is mandatory"
55
60
term-help
You can’t perform that action at this time.
0 commit comments