mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Minor issues in app questions parsing
This commit is contained in:
parent
a60cd4f559
commit
674d8e7cb9
1 changed files with 4 additions and 4 deletions
|
@ -2542,7 +2542,7 @@ class YunoHostArgumentFormatParser(object):
|
||||||
question.value = None
|
question.value = None
|
||||||
|
|
||||||
# we don't have an answer, check optional and default_value
|
# we don't have an answer, check optional and default_value
|
||||||
if question.value is None:
|
if question.value is None or question.value == '':
|
||||||
if not question.optional and question.default is None:
|
if not question.optional and question.default is None:
|
||||||
raise YunohostError('app_argument_required', name=question.name)
|
raise YunohostError('app_argument_required', name=question.name)
|
||||||
else:
|
else:
|
||||||
|
@ -2566,12 +2566,12 @@ class YunoHostArgumentFormatParser(object):
|
||||||
def _format_text_for_user_input_in_cli(self, question):
|
def _format_text_for_user_input_in_cli(self, question):
|
||||||
text_for_user_input_in_cli = _value_for_locale(question.ask)
|
text_for_user_input_in_cli = _value_for_locale(question.ask)
|
||||||
|
|
||||||
if question.default is not None:
|
|
||||||
text_for_user_input_in_cli += ' (default: {0})'.format(question.default)
|
|
||||||
|
|
||||||
if question.choices:
|
if question.choices:
|
||||||
text_for_user_input_in_cli += ' [{0}]'.format(' | '.join(question.choices))
|
text_for_user_input_in_cli += ' [{0}]'.format(' | '.join(question.choices))
|
||||||
|
|
||||||
|
if question.default is not None:
|
||||||
|
text_for_user_input_in_cli += ' (default: {0})'.format(question.default)
|
||||||
|
|
||||||
return text_for_user_input_in_cli
|
return text_for_user_input_in_cli
|
||||||
|
|
||||||
def _post_parse_value(self, question):
|
def _post_parse_value(self, question):
|
||||||
|
|
Loading…
Add table
Reference in a new issue