[enh] Use node anchors for patterns in the actionsmap

This commit is contained in:
Jérôme Lebleu 2015-01-06 15:42:16 +01:00
parent 70da9abedf
commit 22675664f0

View file

@ -98,43 +98,43 @@ user:
username: username:
help: The unique username to create help: The unique username to create
extra: extra:
pattern: pattern: &pattern_username
- '^[a-z0-9_]+$' - !!str ^[a-z0-9_]+$
- pattern_username - "pattern_username"
-f: -f:
full: --firstname full: --firstname
extra: extra:
ask: ask_firstname ask: ask_firstname
required: True required: True
pattern: pattern: &pattern_firstname
- "^([^\\W\\d_]{2,30}[ ,.'-]{0,3})+$" - !!str ^([^\W\d_]{2,30}[ ,.'-]{0,3})+$
- pattern_firstname - "pattern_firstname"
-l: -l:
full: --lastname full: --lastname
extra: extra:
ask: ask_lastname ask: ask_lastname
required: True required: True
pattern: pattern: &pattern_lastname
- "^([^\\W\\d_]{2,30}[ ,.']{0,3})+$" - !!str ^([^\W\d_]{2,30}[ ,.']{0,3})+$
- pattern_lastname - "pattern_lastname"
-m: -m:
full: --mail full: --mail
help: Main unique email address help: Main unique email address
extra: extra:
ask: ask_email ask: ask_email
required: True required: True
pattern: pattern: &pattern_email
- '^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,6}$' - !!str ^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,6}$
- pattern_email - "pattern_email"
-p: -p:
full: --password full: --password
help: User password help: User password
extra: extra:
password: ask_password password: ask_password
required: True required: True
pattern: pattern: &pattern_password
- '^.{3,}$' - !!str ^.{3,}$
- pattern_password - "pattern_password"
### user_delete() ### user_delete()
delete: delete:
@ -146,9 +146,7 @@ user:
username: username:
help: Username to delete help: Username to delete
extra: extra:
pattern: pattern: *pattern_username
- '^[a-z0-9_]+$'
- pattern_username
--purge: --purge:
action: store_true action: store_true
@ -164,33 +162,27 @@ user:
-f: -f:
full: --firstname full: --firstname
extra: extra:
pattern: pattern: *pattern_firstname
- "^([^\\W\\d_]{2,30}[ ,.']{0,3})+$"
- pattern_firstname
-l: -l:
full: --lastname full: --lastname
extra: extra:
pattern: pattern: *pattern_lastname
- "^([^\\W\\d_]{2,30}[ ,.']{0,3})+$"
- pattern_lastname
-m: -m:
full: --mail full: --mail
extra: extra:
pattern: pattern: *pattern_email
- '^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,6}$'
- pattern_email
-p: -p:
full: --change-password full: --change-password
help: New password to set help: New password to set
metavar: PASSWORD metavar: PASSWORD
extra: extra:
pattern: pattern: *pattern_password
- '^.{3,}$'
- pattern_password
--add-mailforward: --add-mailforward:
help: Mailforward addresses to add help: Mailforward addresses to add
nargs: "*" nargs: "*"
metavar: MAIL metavar: MAIL
extra:
pattern: *pattern_email
--remove-mailforward: --remove-mailforward:
help: Mailforward addresses to remove help: Mailforward addresses to remove
nargs: "*" nargs: "*"
@ -199,6 +191,8 @@ user:
help: Mail aliases to add help: Mail aliases to add
nargs: "*" nargs: "*"
metavar: MAIL metavar: MAIL
extra:
pattern: *pattern_email
--remove-mailalias: --remove-mailalias:
help: Mail aliases to remove help: Mail aliases to remove
nargs: "*" nargs: "*"
@ -253,9 +247,9 @@ domain:
domain: domain:
help: Domain name to add help: Domain name to add
extra: extra:
pattern: pattern: &pattern_domain
- '^([^\W_A-Z]+([-]*[^\W_A-Z]+)*\.)+[a-z]{2,}$' - !!str ^([^\W_A-Z]+([-]*[^\W_A-Z]+)*\.)+[a-z]{2,}$
- pattern_domain - "pattern_domain"
-d: -d:
full: --dyndns full: --dyndns
help: Subscribe to the DynDNS service help: Subscribe to the DynDNS service
@ -271,9 +265,7 @@ domain:
domain: domain:
help: Domain to delete help: Domain to delete
extra: extra:
pattern: pattern: *pattern_domain
- '^([^\W_A-Z]+([-]*[^\W_A-Z]+)*\.)+[a-z]{2,}$'
- pattern_domain
### domain_info() ### domain_info()
# info: # info:
@ -307,9 +299,9 @@ app:
full: --name full: --name
help: Name of the list (default fapp) help: Name of the list (default fapp)
extra: extra:
pattern: pattern: &pattern_listname
- '^[a-z0-9_]+$' - !!str ^[a-z0-9_]+$
- pattern_listname - "pattern_listname"
### app_listlists() ### app_listlists()
listlists: listlists:
@ -325,9 +317,7 @@ app:
help: Name of the list to remove help: Name of the list to remove
extra: extra:
ask: ask_list_to_remove ask: ask_list_to_remove
pattern: pattern: *pattern_listname
- '^[a-z0-9_]+$'
- pattern_listname
### app_list() ### app_list()
list: list:
@ -376,9 +366,7 @@ app:
full: --user full: --user
help: Allowed app map for a user help: Allowed app map for a user
extra: extra:
pattern: pattern: *pattern_username
- '^[a-z0-9_]+$'
- pattern_username
### app_install() ### app_install()
install: install:
@ -454,9 +442,9 @@ app:
port: port:
help: Port to check help: Port to check
extra: extra:
pattern: pattern: &pattern_port
- '^([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])$' - !!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 - "pattern_port"
### app_checkurl() ### app_checkurl()
checkurl: checkurl:
@ -568,9 +556,9 @@ backup:
full: --name full: --name
help: Name of the backup archive help: Name of the backup archive
extra: extra:
pattern: pattern: &pattern_backup_archive_name
- '^[\w\-\.]{1,30}(?<!\.)$' - !!str ^[\w\-\.]{1,30}(?<!\.)$
- pattern_backup_archive_name - "pattern_backup_archive_name"
-d: -d:
full: --description full: --description
help: Short description of the backup help: Short description of the backup
@ -583,7 +571,7 @@ backup:
action: store_true action: store_true
--hooks: --hooks:
help: List of backup hooks names to execute help: List of backup hooks names to execute
nargs: '*' nargs: "*"
--ignore-apps: --ignore-apps:
help: Do not backup apps help: Do not backup apps
action: store_true action: store_true
@ -599,7 +587,7 @@ backup:
help: Name of the local backup archive help: Name of the local backup archive
--hooks: --hooks:
help: List of restauration hooks names to execute help: List of restauration hooks names to execute
nargs: '*' nargs: "*"
--ignore-apps: --ignore-apps:
help: Do not restore apps help: Do not restore apps
action: store_true action: store_true
@ -780,7 +768,7 @@ service:
-l: -l:
full: --log full: --log
help: Absolute path to log file to display help: Absolute path to log file to display
nargs: + nargs: "+"
-r: -r:
full: --runlevel full: --runlevel
help: Runlevel priority of the service help: Runlevel priority of the service
@ -801,7 +789,7 @@ service:
arguments: arguments:
names: names:
help: Service name to start help: Service name to start
nargs: + nargs: "+"
metavar: NAME metavar: NAME
### service_stop() ### service_stop()
@ -811,7 +799,7 @@ service:
arguments: arguments:
names: names:
help: Service name to stop help: Service name to stop
nargs: + nargs: "+"
metavar: NAME metavar: NAME
### service_enable() ### service_enable()
@ -821,7 +809,7 @@ service:
arguments: arguments:
names: names:
help: Service name to enable help: Service name to enable
nargs: + nargs: "+"
metavar: NAME metavar: NAME
### service_disable() ### service_disable()
@ -831,7 +819,7 @@ service:
arguments: arguments:
names: names:
help: Service name to disable help: Service name to disable
nargs: + nargs: "+"
metavar: NAME metavar: NAME
### service_status() ### service_status()
@ -890,9 +878,7 @@ firewall:
port: port:
help: Port to open help: Port to open
extra: extra:
pattern: pattern: *pattern_port
- '^([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
protocol: protocol:
help: Protocol associated with port help: Protocol associated with port
choices: choices:
@ -916,9 +902,7 @@ firewall:
port: port:
help: Port to close help: Port to close
extra: extra:
pattern: pattern: *pattern_port
- '^([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
protocol: protocol:
help: Protocol associated with port help: Protocol associated with port
choices: choices:
@ -974,6 +958,8 @@ dyndns:
-d: -d:
full: --domain full: --domain
help: Full domain to subscribe with help: Full domain to subscribe with
extra:
pattern: *pattern_domain
-k: -k:
full: --key full: --key
help: Public DNS key help: Public DNS key
@ -989,6 +975,8 @@ dyndns:
-d: -d:
full: --domain full: --domain
help: Full domain to subscribe with help: Full domain to subscribe with
extra:
pattern: *pattern_domain
-k: -k:
full: --key full: --key
help: Public DNS key help: Public DNS key
@ -1032,10 +1020,8 @@ tools:
full: --new-password full: --new-password
extra: extra:
password: ask_new_admin_password password: ask_new_admin_password
pattern: *pattern_password
required: True required: True
pattern:
- '^.{3,}$'
- pattern_password
### tools_maindomain() ### tools_maindomain()
maindomain: maindomain:
@ -1047,15 +1033,11 @@ tools:
-o: -o:
full: --old-domain full: --old-domain
extra: extra:
pattern: pattern: *pattern_domain
- '^([^\W_A-Z]+([-]*[^\W_A-Z]+)*\.)+[a-z]{2,}$'
- pattern_domain
-n: -n:
full: --new-domain full: --new-domain
extra: extra:
pattern: pattern: *pattern_domain
- '^([^\W_A-Z]+([-]*[^\W_A-Z]+)*\.)+[a-z]{2,}$'
- pattern_domain
### tools_postinstall() ### tools_postinstall()
postinstall: postinstall:
@ -1070,19 +1052,15 @@ tools:
help: YunoHost main domain help: YunoHost main domain
extra: extra:
ask: ask_main_domain ask: ask_main_domain
pattern: pattern: *pattern_domain
- '^([^\W_A-Z]+([-]*[^\W_A-Z]+)*\.)+[a-z]{2,}$'
- pattern_domain
required: True required: True
-p: -p:
full: --password full: --password
help: YunoHost admin password help: YunoHost admin password
extra: extra:
password: ask_new_admin_password password: ask_new_admin_password
pattern: *pattern_password
required: True required: True
pattern:
- '^.{3,}$'
- pattern_password
--ignore-dyndns: --ignore-dyndns:
help: Do not subscribe domain to a DynDNS service help: Do not subscribe domain to a DynDNS service
action: store_true action: store_true
@ -1173,11 +1151,11 @@ hook:
-n: -n:
full: --hooks full: --hooks
help: List of hooks names to execute help: List of hooks names to execute
nargs: '*' nargs: "*"
-a: -a:
full: --args full: --args
help: Ordered list of arguments to pass to the script help: Ordered list of arguments to pass to the script
nargs: '*' nargs: "*"
### hook_check() ### hook_check()
check: check: