Easily turn Nushell modules into cross-shell CLI tools
library nu nushell
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add flag to show hidden functions

+9 -3
+2 -1
README.md
··· 18 18 ### Hidden Functions ### 19 19 20 20 You can hide functions from being listed in the help menu by prefixing them with an underscore (`_`). They will still be 21 - executable when ran directly. This feature may be useful for debug or one-time migration functions. 21 + executable when ran directly, and can be shown with the `--list-all` flag. This feature may be useful for debug or 22 + one-time migration functions.
+7 -2
template.nu
··· 13 13 # TODO: --choose (-c) # Interactively choose a function 14 14 --help (-h) 15 15 --list (-l) # List available commands 16 + --list-all # List all available commands, including hidden ones 16 17 --interactive (-i) # Enter interactive shell with the module loaded 17 18 ...cmd 18 19 ] { 19 20 if $interactive { 20 21 exec nu -e $"use ($module_path); print '(ansi yellow)Module loaded.(ansi reset)'" 22 + } else if $list_all { 23 + print-functions --all 21 24 } else if $help or $list or ($cmd | length) == 0 { 22 25 print-functions 23 26 } else { ··· 39 42 | get 0.commands.name 40 43 } 41 44 42 - def print-functions [] { 45 + def print-functions [ 46 + --all (-a) # show hidden functions 47 + ] { 43 48 get-functions 44 - | where not ($it starts-with "_") 49 + | if $all {$in} else {$in | where $it not-starts-with "_"} 45 50 | each {|function| 46 51 let usage = if $print_usage { 47 52 let help = help $module_name $function | lines