Skip to content

Commit 5cdff5e

Browse files
committed
Allow prompt to return a specific value for force_arg
1 parent f5af4f9 commit 5cdff5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_shell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ def print_colored(message, color):
145145
colorize = getattr(colored, color)
146146
print(colorize(message))
147147

148-
def prompt(self, message, *, default=None, force_arg=None):
148+
def prompt(self, message, *, default=None, force_arg=None, force_arg_value=True):
149149
"""
150150
A Yes/No prompt that accepts optional defaults
151151
Returns True for Yes and False for No
152152
"""
153153
if force_arg is not None and self.argument_exists(force_arg):
154-
return True
154+
return force_arg_value
155155
if default is None:
156156
choicebox = "[y/n]"
157157
else:

0 commit comments

Comments
 (0)