mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
readme: factor out hardcoded paths on code snippets with getvar
This commit is contained in:
40
getvar
Executable file
40
getvar
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
while getopts ha:gL:M:N:n:Q:t: OPT; do
|
||||
case "$OPT" in
|
||||
h)
|
||||
echo "https://github.com/cirosantilli/linux-kernel-module-cheat#getvar" 2>&1
|
||||
exit 0
|
||||
;;
|
||||
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
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift "$(($OPTIND - 1))"
|
||||
common_setup
|
||||
eval "echo \$common_${1}"
|
||||
Reference in New Issue
Block a user