provisioning/core/nulib/lib_provisioning/utils/undefined.nu

25 lines
953 B
Plaintext
Raw Normal View History

export def option_undefined [
root: string
src: string
info?: string
] {
_print $"🛑 invalid_option ($src) ($info)"
_print $"\nUse (_ansi blue_bold)($env.PROVISIONING_NAME) ($root) ($src) help(_ansi reset) for help on commands and options"
}
export def invalid_task [
src: string
task: string
--end
] {
let show_src = {|color|
if $src == "" { "" } else { $" (_ansi $color)($src)(_ansi reset)"}
}
if $task != "" {
_print $"🛑 invalid (_ansi blue)($env.PROVISIONING_NAME)(_ansi reset)(do $show_src "yellow") task or option: (_ansi red)($task)(_ansi reset)"
} else {
_print $"(_ansi blue)($env.PROVISIONING_NAME)(_ansi reset)(do $show_src "yellow") no task or option found !"
}
_print $"Use (_ansi blue_bold)($env.PROVISIONING_NAME)(_ansi reset)(do $show_src "blue_bold") (_ansi blue_bold)help(_ansi reset) for help on commands and options"
if $end and not $env.PROVISIONING_DEBUG { end_run "" }
}