diff options
author | Patrick Spek <p.spek@tyil.nl> | 2022-05-06 19:18:31 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2022-05-06 19:18:31 +0200 |
commit | 06f2b1311d5ecb3b19d9b50aca758767144a429f (patch) | |
tree | 5bcfc58cf4c78b1d5b395b73800fb9a55f732632 | |
parent | 22a9151b76bd9b26ceefcb39cb54b9f7fafee0b4 (diff) |
Add -p argument to var subcommand
-rw-r--r-- | lib/subcommands/var.bash | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/subcommands/var.bash b/lib/subcommands/var.bash index 60bfe81..3e8fc0b 100644 --- a/lib/subcommands/var.bash +++ b/lib/subcommands/var.bash @@ -9,7 +9,16 @@ subcommand() local key local value - # TODO: Handle opts + # Handle opts + while getopts ":p:" opt + do + case "$opt" in + p) export BASHTARD_PLAYBOOK="$OPTARG" ;; + *) emerg "Unused opt '$opt'?" ;; + esac + done + + shift $(( OPTIND - 1 )) key="$1" ; shift value="$1" ; shift |