use primitives/io/interface.nu [end_run] use primitives/io/logging.nu [is-debug-enabled] use primitives/infra/init.nu [get-provisioning-name] export def parse_help_command [ source: string name?: string --task: closure --ismod --end ] { 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 { "" } ^(get-provisioning-name) $mod_str ...($source | split row " ") --help if $task != null { do $task } if $end { if not (is-debug-enabled) { end_run "" } exit } }