save
This commit is contained in:
62
bin/.local/bin/javar
Executable file
62
bin/.local/bin/javar
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Usage: $0 [java-source]
|
||||
|
||||
prog_name=$(basename $0)
|
||||
tool_version="beta"
|
||||
year=2025
|
||||
|
||||
fatal() {
|
||||
echo "fatal: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
run() {
|
||||
"$@" || fatal "could not run: $*"
|
||||
}
|
||||
|
||||
print_help() {
|
||||
cat <<EOF
|
||||
Usage: $prog_name [java-source]...
|
||||
|
||||
--help print this help and exit.
|
||||
--version print version information.
|
||||
|
||||
--save-temps don't clean up all intermediate steps
|
||||
EOF
|
||||
}
|
||||
|
||||
print_version() {
|
||||
cat <<EOF
|
||||
$prog_name $tool_version $(git rev-list --count --all 2>/dev/null || echo 0)
|
||||
Copyright (C) $year vx-clutch.
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
EOF
|
||||
}
|
||||
|
||||
clean=true
|
||||
cleanup() {
|
||||
local class=$1
|
||||
$clean && rm $class.class
|
||||
}
|
||||
|
||||
runner() {
|
||||
local class=$1
|
||||
class="${class%.java}"
|
||||
run javac $class.java
|
||||
run java $class
|
||||
cleanup $class
|
||||
}
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--help) print_help; exit 0 ;;
|
||||
--version) print_version; exit 0 ;;
|
||||
--save-temps) clean=false ;;
|
||||
*)
|
||||
runner $1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
51
bin/.local/bin/probe
Executable file
51
bin/.local/bin/probe
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
|
||||
# TODO: if optional name if not prompt for name.
|
||||
|
||||
# Usage: $0 [name]
|
||||
|
||||
prog_name=$(basename $0)
|
||||
tool_version="beta"
|
||||
year=2025
|
||||
|
||||
fatal() {
|
||||
echo "fatal: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
run() {
|
||||
"$@" || fatal "could not run: $*"
|
||||
}
|
||||
|
||||
print_help() {
|
||||
cat <<EOF
|
||||
Usage: $prog_name [name]...
|
||||
|
||||
--help print this help and exit.
|
||||
--version print version information.
|
||||
EOF
|
||||
}
|
||||
|
||||
print_version() {
|
||||
cat <<EOF
|
||||
$prog_name $tool_version $(git rev-list --count --all 2>/dev/null || echo 0)
|
||||
Copyright (C) $year vx-clutch.
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
EOF
|
||||
}
|
||||
|
||||
new_proj() {
|
||||
fatal "NOT IMPL"
|
||||
}
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--help) print_help; exit 0 ;;
|
||||
--version) print_version; exit 0 ;;
|
||||
*)
|
||||
new_proj $1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
Reference in New Issue
Block a user