Skip to content

Commit

Permalink
docs(lib/utils): describe "_omb_util_{split,expand_glob}" in code com…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
akinomyoga committed Apr 28, 2024
1 parent 808ab59 commit e52a30e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ' <tab><newline>'.
function _omb_util_split {
local __set=$- IFS=${3:-$' \t\n'}
set -f
Expand All @@ -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
Expand Down

0 comments on commit e52a30e

Please sign in to comment.