From 91eb824daa14a6bfa3df05c69147cdce21a246ef Mon Sep 17 00:00:00 2001 From: Elias Fierke Date: Wed, 28 Jan 2026 19:18:02 +0100 Subject: [PATCH] implemented a basic structure (no features) --- src/paperctl.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) mode change 100644 => 100755 src/paperctl.sh diff --git a/src/paperctl.sh b/src/paperctl.sh old mode 100644 new mode 100755 index e69de29..79f8121 --- a/src/paperctl.sh +++ b/src/paperctl.sh @@ -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