common: factor out common opts to all scripts

This commit is contained in:
Ciro Santilli
2018-08-14 00:27:55 +01:00
parent 0f5c5a9912
commit 63ec42f72f
14 changed files with 84 additions and 145 deletions

28
getvar
View File

@@ -1,37 +1,13 @@
#!/usr/bin/env bash
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
while getopts ha:gL:M:N:n:Q:t: OPT; do
while getopts "h${common_getopts_flags}" OPT; do
case "$OPT" in
h)
echo "https://github.com/cirosantilli/linux-kernel-module-cheat#getvar" 2>&1
exit
;;
a)
common_arch="$OPTARG"
;;
g)
common_gem5=true
;;
L)
common_linux_variant="$OPTARG"
;;
M)
common_gem5_variant="$OPTARG"
;;
N)
common_gem5_worktree="$OPTARG"
;;
n)
common_run_id="$OPTARG"
;;
Q)
common_qemu_variant="$OPTARG"
;;
t)
common_gem5_build_type="$OPTARG"
;;
?)
exit 2
common_getopts_case "$OPT"
;;
esac
done