mirror of
https://github.com/p8952/bocker.git
synced 2025-11-08 19:54:01 +01:00
Use the actual executable path in the help messages
And it doesn't cost any lines
This commit is contained in:
parent
dbbeaf8732
commit
3bf68db6a4
18
bocker
18
bocker
@ -71,21 +71,21 @@ btrfs subvolume snapshot "$btrfs_path/$1" "$btrfs_path/$2" > /dev/null
|
|||||||
echo "Created: $2"
|
echo "Created: $2"
|
||||||
}
|
}
|
||||||
function HELP() {
|
function HELP() {
|
||||||
sed -n "s/\\\\n/\n\t/g;s/$/\n/;s/^.*#HELP\\s//p;" < $1
|
sed -n "s/\\\\n/\n\t/g;s/BOCKER/${1/\//\\\/}/g;s/$/\n/;s/^.*#HELP\\s//p;" < $1
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
[[ -z "${1-}" ]] && HELP $0
|
[[ -z "${1-}" ]] && HELP $0
|
||||||
case $1 in
|
case $1 in
|
||||||
init) INIT "$2" ;; #HELP Create an image:\n./bocker init <image_directory>
|
init) INIT "$2" ;; #HELP Create an image:\nBOCKER init <image_directory>
|
||||||
images) IMAGES ;; #HELP List images:\n./bocker images
|
images) IMAGES ;; #HELP List images:\nBOCKER images
|
||||||
run) #HELP Create a container:\n./bocker run <image_id> <command>
|
run) #HELP Create a container:\nBOCKER run <image_id> <command>
|
||||||
IMAGE="$2"
|
IMAGE="$2"
|
||||||
shift && shift
|
shift && shift
|
||||||
RUN "$IMAGE" "$*"
|
RUN "$IMAGE" "$*"
|
||||||
;;
|
;;
|
||||||
ps) PS ;; #HELP List containers:\n./bocker ps
|
ps) PS ;; #HELP List containers:\nBOCKER ps
|
||||||
logs) LOGS "$2" ;; #HELP View logs from a container:\n./bocker logs <container_id>
|
logs) LOGS "$2" ;; #HELP View logs from a container:\nBOCKER logs <container_id>
|
||||||
commit) COMMIT "$2" "$3" ;; #HELP Commit a container to the image:\n./bocker commit <container_id> <image_id>
|
commit) COMMIT "$2" "$3" ;; #HELP Commit a container to the image:\nBOCKER commit <container_id> <image_id>
|
||||||
rm) RM "$2" ;; #HELP Delete an image or container:\n./bocker rm <image_id or container_id>
|
rm) RM "$2" ;; #HELP Delete an image or container:\nBOCKER rm <image_id or container_id>
|
||||||
*) HELP $0 ;; #HELP Display this message:\n./bocker help
|
*) HELP $0 ;; #HELP Display this message:\nBOCKER help
|
||||||
esac
|
esac
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user