implemented a basic structure (no features)
This commit is contained in:
44
src/paperctl.sh
Normal file → Executable file
44
src/paperctl.sh
Normal file → Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Welcome to paperctl, the ultimate cli client/server management tool"
|
||||||
|
echo "(c)2026 - MyPapertown, MyPaperCloud, Elias Fierke"
|
||||||
|
echo "Version 1.0"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
show_help(){
|
||||||
|
echo "-- HELP --"
|
||||||
|
echo " -v | Print the current application version"
|
||||||
|
echo " -h | Show this help text"
|
||||||
|
echo " -y | Answer all questions with yes"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
print_config(){
|
||||||
|
echo "-- CURRENT CONFIG --"
|
||||||
|
cat $HOME/.config/paperctl.cfg
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ "$1" == "access" ]]; then
|
||||||
|
|
||||||
|
shift
|
||||||
|
|
||||||
|
if [[ -x "./sub/access.sh" ]]; then
|
||||||
|
./sub/access.sh "$@"
|
||||||
|
else
|
||||||
|
echo "Command 'access' not found!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
while getopts ":cyhv" opt; do
|
||||||
|
case $opt in
|
||||||
|
c) print_config ;;
|
||||||
|
v) exit 0 ;;
|
||||||
|
h) show_help ;;
|
||||||
|
y) ALWAYS_YES="1" ;;
|
||||||
|
\?) echo "Unknown option: -$OPTARG" >&2; exit 1 ;;
|
||||||
|
:) echo "Option -$OPTARG needs an argument" >&2; exit 1 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user