Conversation

Problem

Related to YunoHost/yunohost#196, it would be nice from a UX point of view to inform the admin/user about the constrain on the password rather than coldly refusing a password after it has been given (probably cancelling the whole command, then the user needs to reanswer every argument)

More generally, there are several case where we might want to add a comment to clarify what is asked. For instance, during the postintall, it may be good to have a comment explaining what is the Main domain and that it can be changed later for instance.

Solution

Allow arguments in the actionmap to specify a string key corresponding to a comment that shall be displayed before asking the argument.

# yunohost tools adminpw
Administration password:
You are defining a new administration password. Beware that you password should be at least 8 characters - though it is good practice to use longer password (passphrases) and/or to use various kind of characters.
New administration password:

Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.