-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmd.sh
executable file
·45 lines (37 loc) · 855 Bytes
/
cmd.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
POSITIONAL_ARGS=()
LANGUAGES=("c" "c++/cpp" "python" "rust/rs" "go" "java" "javascript/js" "typescript/ts" "neovim")
DESTINATION="."
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
HELP=true
break
;;
-g|--git)
GIT=true
shift
;;
-l|--list)
LIST=true
shift
;;
*)
POSITIONAL_ARGS+=("$1")
shift
;;
esac
done
if [[ $HELP ]]; then
echo "Usage: cmd.sh [options] [files]"
echo "Options:"
echo " -h, --help: Show this help message"
echo " -g, --git: Initialize a git repository"
echo " -l, --list: List all available languages"
exit 0
fi
if [[ $LIST ]]; then
echo "Available languages:"
echo " ${LANGUAGES[@]}"
exit 0
fi