aboutsummaryrefslogtreecommitdiff
path: root/sbdata/task.py
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-04-20 17:49:59 +0200
committernea <romangraef@gmail.com>2022-04-20 17:49:59 +0200
commitd9296584270f1e902944fc7390d0b43c34aa2dbb (patch)
tree09d04658c94cdaf7a4fb4fc9e8a81d111edab959 /sbdata/task.py
parenta61b3f9e2b8b2eeb9d556b5f477d2a479b9f7643 (diff)
downloadsbdata-d9296584270f1e902944fc7390d0b43c34aa2dbb.tar.gz
sbdata-d9296584270f1e902944fc7390d0b43c34aa2dbb.tar.bz2
sbdata-d9296584270f1e902944fc7390d0b43c34aa2dbb.zip
literal tos violations
Diffstat (limited to 'sbdata/task.py')
-rw-r--r--sbdata/task.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/sbdata/task.py b/sbdata/task.py
index 7011ca2..90f23e6 100644
--- a/sbdata/task.py
+++ b/sbdata/task.py
@@ -40,6 +40,9 @@ class Arguments:
return question.ask()
return value
+ def get_arg(self, label: str, arg_name: str, mapper: typing.Callable[[str], _T]) -> _T:
+ return mapper(self.get_value(label, self.args.get(arg_name), questionary.text('Missing ' + label)))
+
def has_flag(self, param: str) -> bool:
return param in self.flags