summarylogtreecommitdiffstats
path: root/executable
diff options
context:
space:
mode:
authorDominic Zimmer2017-06-07 09:31:01 +0000
committerDominic Zimmer2017-06-07 09:31:01 +0000
commit0fabf3b11275495d4ce81151bc17ee7f5d174233 (patch)
tree08f8f6b751cafabc2c7b8b3e811f8bcb8a9d51b4 /executable
parent18a299de4435f0273f2e967cca71830038d59183 (diff)
downloadaur-0fabf3b11275495d4ce81151bc17ee7f5d174233.tar.gz
updated executable, covering the messy commandline parsing
Diffstat (limited to 'executable')
-rwxr-xr-x[-rw-r--r--]executable34
1 files changed, 33 insertions, 1 deletions
diff --git a/executable b/executable
index b94f6ca6cc1f..92295695e42a 100644..100755
--- a/executable
+++ b/executable
@@ -1,2 +1,34 @@
#!/bin/bash
-sudo java -jar /usr/share/pseucoco/pseucoco-2.3.jar $@
+function helppage {
+ echo "Usage: $(basename $0) [OPTION] <filename>"
+ echo ""
+ echo " -h, --help Display this help and exit"
+ echo " -v, --version Display the pseucoco version and exit"
+
+}
+function pseucoco {
+ sudo java -jar /usr/share/pseucoco/pseucoco-2.3.jar $@
+}
+
+if [ $# -gt 1 ]
+then
+ helppage
+elif [ $# -lt 1 ]
+then
+ pseucoco
+else
+ if [[ "$1" == "-h" || "$1" == "--help" ]]
+ then
+ helppage
+ elif [[ "$1" == "-v" || "$1" == "--version" ]]
+ then
+ pseucoco -version
+ else
+ if [[ -e $1 ]]
+ then
+ pseucoco -i $1
+ else
+ echo "Error: File \"$1\" not found."
+ fi
+ fi
+fi