mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
common: factor out common opts to all scripts
This commit is contained in:
38
common
38
common
@@ -24,6 +24,44 @@ common_bench_cmd() (
|
||||
printf "exit_status $?\n" >> "$results_file"
|
||||
)
|
||||
|
||||
|
||||
# Handle options common across multiple scripts.
|
||||
common_getopts_case() {
|
||||
case "$1" in
|
||||
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"
|
||||
;;
|
||||
s)
|
||||
common_suffix="$OPTARG"
|
||||
;;
|
||||
t)
|
||||
common_gem5_build_type="$OPTARG"
|
||||
;;
|
||||
?)
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
}
|
||||
common_getopts_flags='a:gL:M:N:n:Q:s:t:'
|
||||
|
||||
# Setup several variables and do other initialization common to most scripts.
|
||||
# Typically done after getting inputs from the command line arguments.
|
||||
common_setup() {
|
||||
|
||||
Reference in New Issue
Block a user