New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to add comments to parameters #175

Merged
merged 1 commit into from Nov 4, 2018

Conversation

Projects
None yet
1 participant
@alexAubin
Member

alexAubin commented Oct 26, 2018

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.

For instance, we may have :

                -n:
                    full: --new-password
                    extra:
                        password: ask_new_admin_password
                        pattern: *pattern_password
                        required: True
                        comment: comment_about_admin_password_strengt

which may produce :

# 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: 

@alexAubin alexAubin added this to the 3.3.x milestone Oct 31, 2018

@alexAubin alexAubin merged commit 4b94bf6 into stretch-unstable Nov 4, 2018

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build failed
Details

@alexAubin alexAubin deleted the allow-to-add-comments-to-parameters branch Nov 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment