Getopt-Long-Bash

 view release on metacpan or  search on metacpan

GETOPTLONG.md  view on Meta::CPAN

*   **Initial Value:** Usually an empty array. An initial value can be set during definition (e.g., `]=(/default/path1 /default/path2)`).

*   **Resetting with `no-` Prefix:** Specifying with `--no-include` resets the array to empty. This is useful for overriding default values. For example, `--no-include --include /new/path` clears any initial values and sets only `/new/path`.

*   **Use Cases:** Multiple input files, multiple configuration items.

#### 4.2.5. Hash Options (`%`)

Accept `key=value` pairs as an associative array (hash).

*   **Definition Example:** `[define|D% # Macro definition (e.g., KEY=VALUE)]`

*   **How to Specify Values:**
    *   Specify the option multiple times: `--define OS=Linux --define VER=1.0`, `-D OS=Linux -D VER=1.0`
    *   Specify multiple pairs with a single option (delimiter controlled by `DELIM` setting; defaults to comma):
        *   `--define OS=Linux,VER=1.0`
        *   `-D OS=Linux,VER=1.0`
    *   If the value (`=VALUE`) is omitted, it's treated as if `=1` was specified (e.g., `--define DEBUG` is interpreted as `DEBUG=1`).

*   **Variable Storage:** Specified keys and values are stored in a Bash associative array (e.g., `declare -A define_map="${define[@]}"; echo "${define_map[OS]}"`).



( run in 1.978 second using v1.01-cache-2.11-cpan-dd78ea5b424 )