From 22675664f0fad747797ce75e1f786a07573e7589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Tue, 6 Jan 2015 15:42:16 +0100 Subject: [PATCH] [enh] Use node anchors for patterns in the actionsmap --- actionsmap/yunohost.yml | 140 +++++++++++++++++----------------------- 1 file changed, 59 insertions(+), 81 deletions(-) diff --git a/actionsmap/yunohost.yml b/actionsmap/yunohost.yml index 60d29a85c..6146a7dff 100644 --- a/actionsmap/yunohost.yml +++ b/actionsmap/yunohost.yml @@ -98,43 +98,43 @@ user: username: help: The unique username to create extra: - pattern: - - '^[a-z0-9_]+$' - - pattern_username + pattern: &pattern_username + - !!str ^[a-z0-9_]+$ + - "pattern_username" -f: full: --firstname extra: ask: ask_firstname required: True - pattern: - - "^([^\\W\\d_]{2,30}[ ,.'-]{0,3})+$" - - pattern_firstname + pattern: &pattern_firstname + - !!str ^([^\W\d_]{2,30}[ ,.'-]{0,3})+$ + - "pattern_firstname" -l: full: --lastname extra: ask: ask_lastname required: True - pattern: - - "^([^\\W\\d_]{2,30}[ ,.']{0,3})+$" - - pattern_lastname + pattern: &pattern_lastname + - !!str ^([^\W\d_]{2,30}[ ,.']{0,3})+$ + - "pattern_lastname" -m: full: --mail help: Main unique email address extra: ask: ask_email required: True - pattern: - - '^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,6}$' - - pattern_email + pattern: &pattern_email + - !!str ^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,6}$ + - "pattern_email" -p: full: --password help: User password extra: password: ask_password required: True - pattern: - - '^.{3,}$' - - pattern_password + pattern: &pattern_password + - !!str ^.{3,}$ + - "pattern_password" ### user_delete() delete: @@ -146,9 +146,7 @@ user: username: help: Username to delete extra: - pattern: - - '^[a-z0-9_]+$' - - pattern_username + pattern: *pattern_username --purge: action: store_true @@ -164,33 +162,27 @@ user: -f: full: --firstname extra: - pattern: - - "^([^\\W\\d_]{2,30}[ ,.']{0,3})+$" - - pattern_firstname + pattern: *pattern_firstname -l: full: --lastname extra: - pattern: - - "^([^\\W\\d_]{2,30}[ ,.']{0,3})+$" - - pattern_lastname + pattern: *pattern_lastname -m: full: --mail extra: - pattern: - - '^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,6}$' - - pattern_email + pattern: *pattern_email -p: full: --change-password help: New password to set metavar: PASSWORD extra: - pattern: - - '^.{3,}$' - - pattern_password + pattern: *pattern_password --add-mailforward: help: Mailforward addresses to add nargs: "*" metavar: MAIL + extra: + pattern: *pattern_email --remove-mailforward: help: Mailforward addresses to remove nargs: "*" @@ -199,6 +191,8 @@ user: help: Mail aliases to add nargs: "*" metavar: MAIL + extra: + pattern: *pattern_email --remove-mailalias: help: Mail aliases to remove nargs: "*" @@ -253,9 +247,9 @@ domain: domain: help: Domain name to add extra: - pattern: - - '^([^\W_A-Z]+([-]*[^\W_A-Z]+)*\.)+[a-z]{2,}$' - - pattern_domain + pattern: &pattern_domain + - !!str ^([^\W_A-Z]+([-]*[^\W_A-Z]+)*\.)+[a-z]{2,}$ + - "pattern_domain" -d: full: --dyndns help: Subscribe to the DynDNS service @@ -271,9 +265,7 @@ domain: domain: help: Domain to delete extra: - pattern: - - '^([^\W_A-Z]+([-]*[^\W_A-Z]+)*\.)+[a-z]{2,}$' - - pattern_domain + pattern: *pattern_domain ### domain_info() # info: @@ -307,9 +299,9 @@ app: full: --name help: Name of the list (default fapp) extra: - pattern: - - '^[a-z0-9_]+$' - - pattern_listname + pattern: &pattern_listname + - !!str ^[a-z0-9_]+$ + - "pattern_listname" ### app_listlists() listlists: @@ -325,9 +317,7 @@ app: help: Name of the list to remove extra: ask: ask_list_to_remove - pattern: - - '^[a-z0-9_]+$' - - pattern_listname + pattern: *pattern_listname ### app_list() list: @@ -376,9 +366,7 @@ app: full: --user help: Allowed app map for a user extra: - pattern: - - '^[a-z0-9_]+$' - - pattern_username + pattern: *pattern_username ### app_install() install: @@ -454,9 +442,9 @@ app: port: help: Port to check extra: - pattern: - - '^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$' - - pattern_port + pattern: &pattern_port + - !!str ^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$ + - "pattern_port" ### app_checkurl() checkurl: @@ -568,9 +556,9 @@ backup: full: --name help: Name of the backup archive extra: - pattern: - - '^[\w\-\.]{1,30}(?