Add shorter argument.

This commit is contained in:
lemniskett 2020-10-29 22:01:19 +07:00
parent 2fecf95027
commit 5ea665eb61

View File

@ -24,9 +24,9 @@ cat << EOF
USAGE: $0 <arguments> USAGE: $0 <arguments>
OPTIONS: OPTIONS:
--create LINK Creates a chroot enviroment. -c, --create URL Creates a chroot enviroment.
--enter Enters chroot enviroment. -e, --enter Enters chroot enviroment.
--help Displays this help message. -h, --help Displays this help message.
EOF EOF
} }
@ -41,7 +41,7 @@ msg(){
} }
case $1 in case $1 in
--create) -c|--create)
asroot asroot
[[ -z $2 ]] && err "Specify the link of Arch Linux bootstrap tarball!" [[ -z $2 ]] && err "Specify the link of Arch Linux bootstrap tarball!"
msg "Creating chroot directory..." msg "Creating chroot directory..."
@ -78,18 +78,18 @@ case $1 in
cp /usr/local/share/archbox/chroot_setup.bash $CHROOT/chroot_setup cp /usr/local/share/archbox/chroot_setup.bash $CHROOT/chroot_setup
chroot $CHROOT /bin/bash -c "sh /chroot_setup" chroot $CHROOT /bin/bash -c "sh /chroot_setup"
;; ;;
--enter) -e|--enter)
storeenv storeenv
copyresolv copyresolv
$PRIV /usr/local/share/archbox/bin/archbox enter $PRIV /usr/local/share/archbox/bin/archbox enter
;; ;;
--help) -h|--help)
help_text help_text
;; ;;
"") "")
help_text help_text
;; ;;
--*) -*)
err "Unknown option: $1" err "Unknown option: $1"
;; ;;
*) *)