Commit 26ec5da5 authored by Benjamin Bouvier's avatar Benjamin Bouvier Committed by hydrargyrum

Fixes #307: Remove remaining uses of is_command;

parent a3fe32c8
...@@ -442,22 +442,16 @@ class ConsoleApplication(Application): ...@@ -442,22 +442,16 @@ class ConsoleApplication(Application):
choices['p'] = 'Prompt value when needed (do not store it)' choices['p'] = 'Prompt value when needed (do not store it)'
choices['s'] = 'Store value in config' choices['s'] = 'Store value in config'
if v.is_command(v.default): if v.default == '' and not v.noprompt:
d = 'c' default = 'p'
elif v.default == '' and not v.noprompt:
d = 'p'
else: else:
d = 's' default = 's'
r = self.ask('*** How do you want to store it?', choices=choices, tiny=True, default=d) r = self.ask('*** How do you want to store it?', choices=choices, tiny=True, default=default)
if r == 'p': if r == 'p':
return '' return ''
if r == 'c': if r == 'c':
print('Enter the shell command that will print the required value on the standard output') print('Enter the shell command that will print the required value on the standard output')
if v.is_command(v.default):
print(': %s' % v.default[1:-1])
else:
d = None
while True: while True:
cmd = self.ask('') cmd = self.ask('')
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment