Replace declare -Ar by local A for args_array

This commit is contained in:
Maniack Crudelis 2020-04-19 19:10:39 +02:00
parent 7cc04f5171
commit 1dd4a73e17
17 changed files with 80 additions and 80 deletions

View file

@ -51,7 +51,7 @@ ynh_wait_dpkg_free() {
ynh_package_is_installed() { ynh_package_is_installed() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=p local legacy_args=p
declare -Ar args_array=( [p]=package= ) local -A args_array=( [p]=package= )
local package local package
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -73,7 +73,7 @@ ynh_package_is_installed() {
ynh_package_version() { ynh_package_version() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=p local legacy_args=p
declare -Ar args_array=( [p]=package= ) local -A args_array=( [p]=package= )
local package local package
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -295,7 +295,7 @@ EOF
ynh_add_app_dependencies () { ynh_add_app_dependencies () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=pr local legacy_args=pr
declare -Ar args_array=( [p]=package= [r]=replace) local -A args_array=( [p]=package= [r]=replace)
local package local package
local replace local replace
# Manage arguments with getopts # Manage arguments with getopts
@ -341,7 +341,7 @@ ynh_remove_app_dependencies () {
ynh_install_extra_app_dependencies () { ynh_install_extra_app_dependencies () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=rpkn local legacy_args=rpkn
declare -Ar args_array=( [r]=repo= [p]=package= [k]=key= [n]=name= ) local -A args_array=( [r]=repo= [p]=package= [k]=key= [n]=name= )
local repo local repo
local package local package
local key local key
@ -379,7 +379,7 @@ ynh_install_extra_app_dependencies () {
ynh_install_extra_repo () { ynh_install_extra_repo () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=rkpna local legacy_args=rkpna
declare -Ar args_array=( [r]=repo= [k]=key= [p]=priority= [n]=name= [a]=append ) local -A args_array=( [r]=repo= [k]=key= [p]=priority= [n]=name= [a]=append )
local repo local repo
local key local key
local priority local priority
@ -448,7 +448,7 @@ ynh_install_extra_repo () {
ynh_remove_extra_repo () { ynh_remove_extra_repo () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=n local legacy_args=n
declare -Ar args_array=( [n]=name= ) local -A args_array=( [n]=name= )
local name local name
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -481,7 +481,7 @@ ynh_remove_extra_repo () {
ynh_add_repo () { ynh_add_repo () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=uscna local legacy_args=uscna
declare -Ar args_array=( [u]=uri= [s]=suite= [c]=component= [n]=name= [a]=append ) local -A args_array=( [u]=uri= [s]=suite= [c]=component= [n]=name= [a]=append )
local uri local uri
local suite local suite
local component local component
@ -521,7 +521,7 @@ ynh_add_repo () {
ynh_pin_repo () { ynh_pin_repo () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=pirna local legacy_args=pirna
declare -Ar args_array=( [p]=package= [i]=pin= [r]=priority= [n]=name= [a]=append ) local -A args_array=( [p]=package= [i]=pin= [r]=priority= [n]=name= [a]=append )
local package local package
local pin local pin
local priority local priority

View file

@ -46,7 +46,7 @@ ynh_backup() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=sdbm local legacy_args=sdbm
declare -Ar args_array=( [s]=src_path= [d]=dest_path= [b]=is_big [m]=not_mandatory ) local -A args_array=( [s]=src_path= [d]=dest_path= [b]=is_big [m]=not_mandatory )
local src_path local src_path
local dest_path local dest_path
local is_big local is_big
@ -220,7 +220,7 @@ with open(sys.argv[1], 'r') as backup_file:
ynh_restore_file () { ynh_restore_file () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=odm local legacy_args=odm
declare -Ar args_array=( [o]=origin_path= [d]=dest_path= [m]=not_mandatory ) local -A args_array=( [o]=origin_path= [d]=dest_path= [m]=not_mandatory )
local origin_path local origin_path
local archive_path local archive_path
local dest_path local dest_path
@ -296,7 +296,7 @@ ynh_bind_or_cp() {
ynh_store_file_checksum () { ynh_store_file_checksum () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=f local legacy_args=f
declare -Ar args_array=( [f]=file= ) local -A args_array=( [f]=file= )
local file local file
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -328,7 +328,7 @@ ynh_store_file_checksum () {
ynh_backup_if_checksum_is_different () { ynh_backup_if_checksum_is_different () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=f local legacy_args=f
declare -Ar args_array=( [f]=file= ) local -A args_array=( [f]=file= )
local file local file
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -361,7 +361,7 @@ ynh_backup_if_checksum_is_different () {
ynh_delete_file_checksum () { ynh_delete_file_checksum () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=f local legacy_args=f
declare -Ar args_array=( [f]=file= ) local -A args_array=( [f]=file= )
local file local file
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"

View file

@ -65,7 +65,7 @@
ynh_add_fail2ban_config () { ynh_add_fail2ban_config () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=lrmptv local legacy_args=lrmptv
declare -Ar args_array=( [l]=logpath= [r]=failregex= [m]=max_retry= [p]=ports= [t]=use_template [v]=others_var=) local -A args_array=( [l]=logpath= [r]=failregex= [m]=max_retry= [p]=ports= [t]=use_template [v]=others_var=)
local logpath local logpath
local failregex local failregex
local max_retry local max_retry

View file

@ -6,7 +6,7 @@
# #
# example: function my_helper() # example: function my_helper()
# { # {
# declare -Ar args_array=( [a]=arg1= [b]=arg2= [c]=arg3 ) # local -A args_array=( [a]=arg1= [b]=arg2= [c]=arg3 )
# local arg1 # local arg1
# local arg2 # local arg2
# local arg3 # local arg3
@ -22,13 +22,13 @@
# This helper need an array, named "args_array" with all the arguments used by the helper # This helper need an array, named "args_array" with all the arguments used by the helper
# that want to use ynh_handle_getopts_args # that want to use ynh_handle_getopts_args
# Be carreful, this array has to be an associative array, as the following example: # Be carreful, this array has to be an associative array, as the following example:
# declare -Ar args_array=( [a]=arg1 [b]=arg2= [c]=arg3 ) # local -A args_array=( [a]=arg1 [b]=arg2= [c]=arg3 )
# Let's explain this array: # Let's explain this array:
# a, b and c are short options, -a, -b and -c # a, b and c are short options, -a, -b and -c
# arg1, arg2 and arg3 are the long options associated to the previous short ones. --arg1, --arg2 and --arg3 # arg1, arg2 and arg3 are the long options associated to the previous short ones. --arg1, --arg2 and --arg3
# For each option, a short and long version has to be defined. # For each option, a short and long version has to be defined.
# Let's see something more significant # Let's see something more significant
# declare -Ar args_array=( [u]=user [f]=finalpath= [d]=database ) # local -A args_array=( [u]=user [f]=finalpath= [d]=database )
# #
# NB: Because we're using 'declare' without -g, the array will be declared as a local variable. # NB: Because we're using 'declare' without -g, the array will be declared as a local variable.
# #

View file

@ -10,7 +10,7 @@
ynh_get_ram () { ynh_get_ram () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=ftso local legacy_args=ftso
declare -Ar args_array=( [f]=free [t]=total [s]=ignore_swap [o]=only_swap ) local -A args_array=( [f]=free [t]=total [s]=ignore_swap [o]=only_swap )
local free local free
local total local total
local ignore_swap local ignore_swap
@ -75,7 +75,7 @@ ynh_get_ram () {
ynh_require_ram () { ynh_require_ram () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=rftso local legacy_args=rftso
declare -Ar args_array=( [r]=required= [f]=free [t]=total [s]=ignore_swap [o]=only_swap ) local -A args_array=( [r]=required= [f]=free [t]=total [s]=ignore_swap [o]=only_swap )
local required local required
local free local free
local total local total

View file

@ -8,7 +8,7 @@
ynh_die() { ynh_die() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=mc local legacy_args=mc
declare -Ar args_array=( [m]=message= [c]=ret_code= ) local -A args_array=( [m]=message= [c]=ret_code= )
local message local message
local ret_code local ret_code
# Manage arguments with getopts # Manage arguments with getopts
@ -26,7 +26,7 @@ ynh_die() {
ynh_print_info() { ynh_print_info() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=m local legacy_args=m
declare -Ar args_array=( [m]=message= ) local -A args_array=( [m]=message= )
local message local message
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -71,7 +71,7 @@ ynh_print_log () {
ynh_print_warn () { ynh_print_warn () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=m local legacy_args=m
declare -Ar args_array=( [m]=message= ) local -A args_array=( [m]=message= )
local message local message
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -88,7 +88,7 @@ ynh_print_warn () {
ynh_print_err () { ynh_print_err () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=m local legacy_args=m
declare -Ar args_array=( [m]=message= ) local -A args_array=( [m]=message= )
local message local message
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -224,7 +224,7 @@ ynh_script_progression () {
set +x set +x
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=mwtl local legacy_args=mwtl
declare -Ar args_array=( [m]=message= [w]=weight= [t]=time [l]=last ) local -A args_array=( [m]=message= [w]=weight= [t]=time [l]=last )
local message local message
local weight local weight
local time local time
@ -320,7 +320,7 @@ ynh_debug () {
set +x set +x
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=mt local legacy_args=mt
declare -Ar args_array=( [m]=message= [t]=trace= ) local -A args_array=( [m]=message= [t]=trace= )
local message local message
local trace local trace
# Manage arguments with getopts # Manage arguments with getopts

View file

@ -19,7 +19,7 @@
ynh_use_logrotate () { ynh_use_logrotate () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=lnuya local legacy_args=lnuya
declare -Ar args_array=( [l]=logfile= [n]=nonappend [u]=specific_user= [y]=non [a]=append ) local -A args_array=( [l]=logfile= [n]=nonappend [u]=specific_user= [y]=non [a]=append )
# [y]=non [a]=append are only for legacy purpose, to not fail on the old option '--non-append' # [y]=non [a]=append are only for legacy purpose, to not fail on the old option '--non-append'
local logfile local logfile
local nonappend local nonappend

View file

@ -16,7 +16,7 @@ MYSQL_ROOT_PWD_FILE=/etc/yunohost/mysql
ynh_mysql_connect_as() { ynh_mysql_connect_as() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=upd local legacy_args=upd
declare -Ar args_array=( [u]=user= [p]=password= [d]=database= ) local -A args_array=( [u]=user= [p]=password= [d]=database= )
local user local user
local password local password
local database local database
@ -37,7 +37,7 @@ ynh_mysql_connect_as() {
ynh_mysql_execute_as_root() { ynh_mysql_execute_as_root() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=sd local legacy_args=sd
declare -Ar args_array=( [s]=sql= [d]=database= ) local -A args_array=( [s]=sql= [d]=database= )
local sql local sql
local database local database
# Manage arguments with getopts # Manage arguments with getopts
@ -58,7 +58,7 @@ ynh_mysql_execute_as_root() {
ynh_mysql_execute_file_as_root() { ynh_mysql_execute_file_as_root() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=fd local legacy_args=fd
declare -Ar args_array=( [f]=file= [d]=database= ) local -A args_array=( [f]=file= [d]=database= )
local file local file
local database local database
# Manage arguments with getopts # Manage arguments with getopts
@ -121,7 +121,7 @@ ynh_mysql_drop_db() {
ynh_mysql_dump_db() { ynh_mysql_dump_db() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=d local legacy_args=d
declare -Ar args_array=( [d]=database= ) local -A args_array=( [d]=database= )
local database local database
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -153,7 +153,7 @@ ynh_mysql_user_exists()
{ {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=u local legacy_args=u
declare -Ar args_array=( [u]=user= ) local -A args_array=( [u]=user= )
local user local user
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -192,7 +192,7 @@ ynh_mysql_drop_user() {
ynh_mysql_setup_db () { ynh_mysql_setup_db () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=unp local legacy_args=unp
declare -Ar args_array=( [u]=db_user= [n]=db_name= [p]=db_pwd= ) local -A args_array=( [u]=db_user= [n]=db_name= [p]=db_pwd= )
local db_user local db_user
local db_name local db_name
db_pwd="" db_pwd=""
@ -217,7 +217,7 @@ ynh_mysql_setup_db () {
ynh_mysql_remove_db () { ynh_mysql_remove_db () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=un local legacy_args=un
declare -Ar args_array=( [u]=db_user= [n]=db_name= ) local -A args_array=( [u]=db_user= [n]=db_name= )
local db_user local db_user
local db_name local db_name
# Manage arguments with getopts # Manage arguments with getopts

View file

@ -11,7 +11,7 @@
ynh_find_port () { ynh_find_port () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=p local legacy_args=p
declare -Ar args_array=( [p]=port= ) local -A args_array=( [p]=port= )
local port local port
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -35,7 +35,7 @@ ynh_find_port () {
ynh_port_available () { ynh_port_available () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=p local legacy_args=p
declare -Ar args_array=( [p]=port= ) local -A args_array=( [p]=port= )
local port local port
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -63,7 +63,7 @@ ynh_validate_ip()
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=fi local legacy_args=fi
declare -Ar args_array=( [f]=family= [i]=ip_address= ) local -A args_array=( [f]=family= [i]=ip_address= )
local family local family
local ip_address local ip_address
# Manage arguments with getopts # Manage arguments with getopts
@ -95,7 +95,7 @@ ynh_validate_ip4()
{ {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=i local legacy_args=i
declare -Ar args_array=( [i]=ip_address= ) local -A args_array=( [i]=ip_address= )
local ip_address local ip_address
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -116,7 +116,7 @@ ynh_validate_ip6()
{ {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=i local legacy_args=i
declare -Ar args_array=( [i]=ip_address= ) local -A args_array=( [i]=ip_address= )
local ip_address local ip_address
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"

View file

@ -68,7 +68,7 @@ ynh_install_nodejs () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=n local legacy_args=n
declare -Ar args_array=( [n]=nodejs_version= ) local -A args_array=( [n]=nodejs_version= )
local nodejs_version local nodejs_version
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"

View file

@ -59,7 +59,7 @@ YNH_PHP_VERSION=${YNH_PHP_VERSION:-$YNH_DEFAULT_PHP_VERSION}
ynh_add_fpm_config () { ynh_add_fpm_config () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=vtufpd local legacy_args=vtufpd
declare -Ar args_array=( [v]=phpversion= [t]=use_template [u]=usage= [f]=footprint= [p]=package= [d]=dedicated_service ) local -A args_array=( [v]=phpversion= [t]=use_template [u]=usage= [f]=footprint= [p]=package= [d]=dedicated_service )
local phpversion local phpversion
local use_template local use_template
local usage local usage
@ -312,7 +312,7 @@ ynh_remove_fpm_config () {
ynh_install_php () { ynh_install_php () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=vp local legacy_args=vp
declare -Ar args_array=( [v]=phpversion= [p]=package= ) local -A args_array=( [v]=phpversion= [p]=package= )
local phpversion local phpversion
local package local package
# Manage arguments with getopts # Manage arguments with getopts
@ -415,7 +415,7 @@ ynh_remove_php () {
ynh_get_scalable_phpfpm () { ynh_get_scalable_phpfpm () {
local legacy_args=ufp local legacy_args=ufp
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
declare -Ar args_array=( [u]=usage= [f]=footprint= [p]=print ) local -A args_array=( [u]=usage= [f]=footprint= [p]=print )
local usage local usage
local footprint local footprint
local print local print

View file

@ -17,7 +17,7 @@ PSQL_ROOT_PWD_FILE=/etc/yunohost/psql
ynh_psql_connect_as() { ynh_psql_connect_as() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=upd local legacy_args=upd
declare -Ar args_array=([u]=user= [p]=password= [d]=database=) local -A args_array=([u]=user= [p]=password= [d]=database=)
local user local user
local password local password
local database local database
@ -38,7 +38,7 @@ ynh_psql_connect_as() {
ynh_psql_execute_as_root() { ynh_psql_execute_as_root() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=sd local legacy_args=sd
declare -Ar args_array=([s]=sql= [d]=database=) local -A args_array=([s]=sql= [d]=database=)
local sql local sql
local database local database
# Manage arguments with getopts # Manage arguments with getopts
@ -59,7 +59,7 @@ ynh_psql_execute_as_root() {
ynh_psql_execute_file_as_root() { ynh_psql_execute_file_as_root() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=fd local legacy_args=fd
declare -Ar args_array=([f]=file= [d]=database=) local -A args_array=([f]=file= [d]=database=)
local file local file
local database local database
# Manage arguments with getopts # Manage arguments with getopts
@ -125,7 +125,7 @@ ynh_psql_drop_db() {
ynh_psql_dump_db() { ynh_psql_dump_db() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=d local legacy_args=d
declare -Ar args_array=([d]=database=) local -A args_array=([d]=database=)
local database local database
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -155,7 +155,7 @@ ynh_psql_create_user() {
ynh_psql_user_exists() { ynh_psql_user_exists() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=u local legacy_args=u
declare -Ar args_array=([u]=user=) local -A args_array=([u]=user=)
local user local user
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -174,7 +174,7 @@ ynh_psql_user_exists() {
ynh_psql_database_exists() { ynh_psql_database_exists() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=d local legacy_args=d
declare -Ar args_array=([d]=database=) local -A args_array=([d]=database=)
local database local database
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -210,7 +210,7 @@ ynh_psql_drop_user() {
ynh_psql_setup_db() { ynh_psql_setup_db() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=unp local legacy_args=unp
declare -Ar args_array=([u]=db_user= [n]=db_name= [p]=db_pwd=) local -A args_array=([u]=db_user= [n]=db_name= [p]=db_pwd=)
local db_user local db_user
local db_name local db_name
db_pwd="" db_pwd=""
@ -237,7 +237,7 @@ ynh_psql_setup_db() {
ynh_psql_remove_db() { ynh_psql_remove_db() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=un local legacy_args=un
declare -Ar args_array=([u]=db_user= [n]=db_name=) local -A args_array=([u]=db_user= [n]=db_name=)
local db_user local db_user
local db_name local db_name
# Manage arguments with getopts # Manage arguments with getopts

View file

@ -10,7 +10,7 @@
ynh_app_setting_get() { ynh_app_setting_get() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=ak local legacy_args=ak
declare -Ar args_array=( [a]=app= [k]=key= ) local -A args_array=( [a]=app= [k]=key= )
local app local app
local key local key
# Manage arguments with getopts # Manage arguments with getopts
@ -30,7 +30,7 @@ ynh_app_setting_get() {
ynh_app_setting_set() { ynh_app_setting_set() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=akv local legacy_args=akv
declare -Ar args_array=( [a]=app= [k]=key= [v]=value= ) local -A args_array=( [a]=app= [k]=key= [v]=value= )
local app local app
local key local key
local value local value
@ -50,7 +50,7 @@ ynh_app_setting_set() {
ynh_app_setting_delete() { ynh_app_setting_delete() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=ak local legacy_args=ak
declare -Ar args_array=( [a]=app= [k]=key= ) local -A args_array=( [a]=app= [k]=key= )
local app local app
local key local key
# Manage arguments with getopts # Manage arguments with getopts
@ -124,7 +124,7 @@ EOF
ynh_webpath_available () { ynh_webpath_available () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=dp local legacy_args=dp
declare -Ar args_array=( [d]=domain= [p]=path_url= ) local -A args_array=( [d]=domain= [p]=path_url= )
local domain local domain
local path_url local path_url
# Manage arguments with getopts # Manage arguments with getopts
@ -146,7 +146,7 @@ ynh_webpath_available () {
ynh_webpath_register () { ynh_webpath_register () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=adp local legacy_args=adp
declare -Ar args_array=( [a]=app= [d]=domain= [p]=path_url= ) local -A args_array=( [a]=app= [d]=domain= [p]=path_url= )
local app local app
local domain local domain
local path_url local path_url
@ -180,7 +180,7 @@ ynh_webpath_register () {
ynh_permission_create() { ynh_permission_create() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=pua local legacy_args=pua
declare -Ar args_array=( [p]=permission= [u]=url= [a]=allowed= ) local -A args_array=( [p]=permission= [u]=url= [a]=allowed= )
local permission local permission
local url local url
local allowed local allowed
@ -210,7 +210,7 @@ ynh_permission_create() {
ynh_permission_delete() { ynh_permission_delete() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=p local legacy_args=p
declare -Ar args_array=( [p]=permission= ) local -A args_array=( [p]=permission= )
local permission local permission
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -226,7 +226,7 @@ ynh_permission_delete() {
ynh_permission_exists() { ynh_permission_exists() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=p local legacy_args=p
declare -Ar args_array=( [p]=permission= ) local -A args_array=( [p]=permission= )
local permission local permission
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -243,7 +243,7 @@ ynh_permission_exists() {
ynh_permission_url() { ynh_permission_url() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=pu local legacy_args=pu
declare -Ar args_array=([p]=permission= [u]=url=) local -A args_array=([p]=permission= [u]=url=)
local permission local permission
local url local url
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -270,7 +270,7 @@ ynh_permission_url() {
ynh_permission_update() { ynh_permission_update() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=par local legacy_args=par
declare -Ar args_array=( [p]=permission= [a]=add= [r]=remove= ) local -A args_array=( [p]=permission= [a]=add= [r]=remove= )
local permission local permission
local add local add
local remove local remove
@ -298,7 +298,7 @@ ynh_permission_update() {
ynh_permission_has_user() { ynh_permission_has_user() {
local legacy_args=pu local legacy_args=pu
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
declare -Ar args_array=( [p]=permission= [u]=user= ) local -A args_array=( [p]=permission= [u]=user= )
local permission local permission
local user local user
# Manage arguments with getopts # Manage arguments with getopts

View file

@ -11,7 +11,7 @@
ynh_string_random() { ynh_string_random() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=l local legacy_args=l
declare -Ar args_array=( [l]=length= ) local -A args_array=( [l]=length= )
local length local length
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -37,7 +37,7 @@ ynh_string_random() {
ynh_replace_string () { ynh_replace_string () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=mrf local legacy_args=mrf
declare -Ar args_array=( [m]=match_string= [r]=replace_string= [f]=target_file= ) local -A args_array=( [m]=match_string= [r]=replace_string= [f]=target_file= )
local match_string local match_string
local replace_string local replace_string
local target_file local target_file
@ -66,7 +66,7 @@ ynh_replace_string () {
ynh_replace_special_string () { ynh_replace_special_string () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=mrf local legacy_args=mrf
declare -Ar args_array=( [m]=match_string= [r]=replace_string= [f]=target_file= ) local -A args_array=( [m]=match_string= [r]=replace_string= [f]=target_file= )
local match_string local match_string
local replace_string local replace_string
local target_file local target_file
@ -97,7 +97,7 @@ ynh_replace_special_string () {
ynh_sanitize_dbid () { ynh_sanitize_dbid () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=n local legacy_args=n
declare -Ar args_array=( [n]=db_name= ) local -A args_array=( [n]=db_name= )
local db_name local db_name
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -125,7 +125,7 @@ ynh_sanitize_dbid () {
ynh_normalize_url_path () { ynh_normalize_url_path () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=p local legacy_args=p
declare -Ar args_array=( [p]=path_url= ) local -A args_array=( [p]=path_url= )
local path_url local path_url
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"

View file

@ -18,7 +18,7 @@
ynh_add_systemd_config () { ynh_add_systemd_config () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=st local legacy_args=st
declare -Ar args_array=( [s]=service= [t]=template= ) local -A args_array=( [s]=service= [t]=template= )
local service local service
local template local template
# Manage arguments with getopts # Manage arguments with getopts
@ -54,7 +54,7 @@ ynh_add_systemd_config () {
ynh_remove_systemd_config () { ynh_remove_systemd_config () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=s local legacy_args=s
declare -Ar args_array=( [s]=service= ) local -A args_array=( [s]=service= )
local service local service
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -81,7 +81,7 @@ ynh_remove_systemd_config () {
ynh_systemd_action() { ynh_systemd_action() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=nalpte local legacy_args=nalpte
declare -Ar args_array=( [n]=service_name= [a]=action= [l]=line_match= [p]=log_path= [t]=timeout= [e]=length= ) local -A args_array=( [n]=service_name= [a]=action= [l]=line_match= [p]=log_path= [t]=timeout= [e]=length= )
local service_name local service_name
local action local action
local line_match local line_match

View file

@ -11,7 +11,7 @@
ynh_user_exists() { ynh_user_exists() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=u local legacy_args=u
declare -Ar args_array=( [u]=username= ) local -A args_array=( [u]=username= )
local username local username
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -32,7 +32,7 @@ ynh_user_exists() {
ynh_user_get_info() { ynh_user_get_info() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=uk local legacy_args=uk
declare -Ar args_array=( [u]=username= [k]=key= ) local -A args_array=( [u]=username= [k]=key= )
local username local username
local key local key
# Manage arguments with getopts # Manage arguments with getopts
@ -63,7 +63,7 @@ ynh_user_list() {
ynh_system_user_exists() { ynh_system_user_exists() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=u local legacy_args=u
declare -Ar args_array=( [u]=username= ) local -A args_array=( [u]=username= )
local username local username
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -78,7 +78,7 @@ ynh_system_user_exists() {
ynh_system_group_exists() { ynh_system_group_exists() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=g local legacy_args=g
declare -Ar args_array=( [g]=group= ) local -A args_array=( [g]=group= )
local group local group
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -103,7 +103,7 @@ ynh_system_group_exists() {
ynh_system_user_create () { ynh_system_user_create () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=uhs local legacy_args=uhs
declare -Ar args_array=( [u]=username= [h]=home_dir= [s]=use_shell ) local -A args_array=( [u]=username= [h]=home_dir= [s]=use_shell )
local username local username
local home_dir local home_dir
local use_shell local use_shell
@ -137,7 +137,7 @@ ynh_system_user_create () {
ynh_system_user_delete () { ynh_system_user_delete () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=u local legacy_args=u
declare -Ar args_array=( [u]=username= ) local -A args_array=( [u]=username= )
local username local username
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"

View file

@ -99,7 +99,7 @@ ynh_abort_if_errors () {
ynh_setup_source () { ynh_setup_source () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=ds local legacy_args=ds
declare -Ar args_array=( [d]=dest_dir= [s]=source_id= ) local -A args_array=( [d]=dest_dir= [s]=source_id= )
local dest_dir local dest_dir
local source_id local source_id
# Manage arguments with getopts # Manage arguments with getopts
@ -304,7 +304,7 @@ properly with chmod/chown."
ynh_secure_remove () { ynh_secure_remove () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=f local legacy_args=f
declare -Ar args_array=( [f]=file= ) local -A args_array=( [f]=file= )
local file local file
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -378,7 +378,7 @@ ynh_get_plain_key() {
ynh_read_manifest () { ynh_read_manifest () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=mk local legacy_args=mk
declare -Ar args_array=( [m]=manifest= [k]=manifest_key= ) local -A args_array=( [m]=manifest= [k]=manifest_key= )
local manifest local manifest
local manifest_key local manifest_key
# Manage arguments with getopts # Manage arguments with getopts
@ -406,7 +406,7 @@ ynh_read_manifest () {
ynh_app_upstream_version () { ynh_app_upstream_version () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=m local legacy_args=m
declare -Ar args_array=( [m]=manifest= ) local -A args_array=( [m]=manifest= )
local manifest local manifest
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
@ -430,7 +430,7 @@ ynh_app_upstream_version () {
ynh_app_package_version () { ynh_app_package_version () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=m local legacy_args=m
declare -Ar args_array=( [m]=manifest= ) local -A args_array=( [m]=manifest= )
local manifest local manifest
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"