mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
docs(lib/utils): describe "_omb_util_{split,expand_glob}" in code comment
This commit is contained in:
14
lib/utils.sh
14
lib/utils.sh
@ -366,6 +366,13 @@ function _omb_util_add_prompt_command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
## @fn _omb_util_split array str [sep]
|
## @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 ' <tab><newline>'.
|
||||||
function _omb_util_split {
|
function _omb_util_split {
|
||||||
local __set=$- IFS=${3:-$' \t\n'}
|
local __set=$- IFS=${3:-$' \t\n'}
|
||||||
set -f
|
set -f
|
||||||
@ -374,6 +381,13 @@ function _omb_util_split {
|
|||||||
return 0
|
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 {
|
function _omb_util_glob_expand {
|
||||||
local __set=$- __shopt __gignore=$GLOBIGNORE
|
local __set=$- __shopt __gignore=$GLOBIGNORE
|
||||||
_omb_util_get_shopt failglob nullglob extglob
|
_omb_util_get_shopt failglob nullglob extglob
|
||||||
|
Reference in New Issue
Block a user