diff --git a/custom-completions/television/readme.md b/custom-completions/television/readme.md new file mode 100644 index 00000000..9b25e263 --- /dev/null +++ b/custom-completions/television/readme.md @@ -0,0 +1,11 @@ +# `television` custom completions + +This script provides custom completions for `television`. +It can be used by importing its exported commands via: + +``` +use path/to/television/television-completions.nu * +``` + +With `path/to/` being either the relative path of the file to your current working directory or its absolute path. + diff --git a/custom-completions/television/television-completions.nu b/custom-completions/television/television-completions.nu new file mode 100644 index 00000000..6af6e3b7 --- /dev/null +++ b/custom-completions/television/television-completions.nu @@ -0,0 +1,19 @@ +def "nu-complete tv channels" [] { + ^tv list-channels + | lines +} + +export extern "tv" [ + channel: string@"nu-complete tv channels" +] + +# Lists the available channels +export extern "tv list-channels" [] +# Initializes shell completion ("tv init zsh") +export extern "tv init" [] +# Generates standard shell tab-completion scripts for tv's various subcommands +export extern "tv completions" [] +# Downloads the latest collection of channel prototypes from github and saves them to the local configuration directory +export extern "tv update-channels" [] +# Print this message or the help of the given subcommand(s) +export extern "tv help" []