summaryrefslogtreecommitdiff
path: root/lxc-create
diff options
context:
space:
mode:
Diffstat (limited to 'lxc-create')
-rwxr-xr-xlxc-create24
1 files changed, 8 insertions, 16 deletions
diff --git a/lxc-create b/lxc-create
index c5a76d8..95b53be 100755
--- a/lxc-create
+++ b/lxc-create
@@ -14,22 +14,14 @@
# Get the list of requested packages.
PACKAGES=$(sed 's/,/ /g' <<< $(cut -d' ' -f1 <<< $(awk -F'--packages ' '{print $2}' <<< "$@")))
-POSITIONAL=()
-while [[ $# -gt 0 ]]
-do
-key="$1"
-
-case $key in
- -n)
- LXC_NAME="$2"
- shift
- shift
- ;;
- *)
- POSITIONAL+=("$1")
- shift
- ;;
-esac
+while getopts "qt:n:" opt; do
+ case $opt in
+ n)
+ LXC_NAME="$OPTARG"
+ ;;
+ *)
+ ;;
+ esac
done
if [ "$PACKAGES" ]; then