From 06f2b1311d5ecb3b19d9b50aca758767144a429f Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Fri, 6 May 2022 19:18:31 +0200 Subject: Add -p argument to var subcommand --- lib/subcommands/var.bash | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 -- cgit v1.1