provisioning/core/nulib/lib_provisioning/utils/help.nu
Jesús Pérez 37ee6486d5 fix: resolve all syntax errors in provisioning modules
Fixed 29 syntax errors across 4 modules:
- servers/ (6 files, 13 errors): Fixed parentheses in PROVISIONING_ARGS expressions
- taskservs/ (4 files, 6 errors): Fixed parentheses in string interpolation
- main_provisioning/ (3 files, 3 errors): Fixed environment variable access
- lib_provisioning/utils/ (2 files, 2 errors): Fixed standalone env access

Pattern fixed:
- $"($env.PROVISIONING_ARGS? | default "") " → $"(($env.PROVISIONING_ARGS? | default "")) "
- $env.PROVISIONING_ARGS? | default "" → ($env.PROVISIONING_ARGS? | default "")

All modules now have valid Nushell syntax for proper parsing.
2025-09-23 00:00:01 +01:00

24 lines
641 B
Plaintext

export def parse_help_command [
source: string
name?: string
--task: closure
--ismod
--end
] {
#use utils/interface.nu end_run
let args = ($env.PROVISIONING_ARGS? | default "")
let has_help = if ($args | str contains "help") or ($args |str ends-with " h") {
true
} else if $name != null and $name == "help" or $name == "h" {
true
} else { false }
if not $has_help { return }
let mod_str = if $ismod { "-mod" } else { "" }
^$env.PROVISIONING_NAME $mod_str ...($source | split row " ") --help
if $task != null { do $task }
if $end {
if not $env.PROVISIONING_DEBUG { end_run "" }
exit
}
}