From e52a30e24f4f4232e9d60300eb7fc51d36473e64 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 28 Apr 2024 13:49:06 +0900 Subject: [PATCH] docs(lib/utils): describe "_omb_util_{split,expand_glob}" in code comment --- lib/utils.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/utils.sh b/lib/utils.sh index 236ba5177..cba8a4681 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -366,6 +366,13 @@ function _omb_util_add_prompt_command { } ## @fn _omb_util_split array str [sep] +## Split STR with SEP in a safe way and store the result in ARRAY. +## @param[out] array +## The name of an array variable to which the split result is stored. +## @param[in] str +## The string to split +## @param[in,opt] +## The set of separator characters. The default is ' '. function _omb_util_split { local __set=$- IFS=${3:-$' \t\n'} set -f @@ -374,6 +381,13 @@ function _omb_util_split { return 0 } +## @fn _omb_util_glob_expand array glob +## Perform the pathname expansion of a glob pattern GLOB in a safe way and +## store the filenames in ARRAY. +## @param[out] array +## The name of an array variable to which the filenames are stored. +## @param[in] glob +## The glob pattern that is attempted to match filenames function _omb_util_glob_expand { local __set=$- __shopt __gignore=$GLOBIGNORE _omb_util_get_shopt failglob nullglob extglob