diff --git a/contrib/tmpl-completions.nu b/contrib/tmpl-completions.nu index 97927cd3b6a4ca01469da0af5aca7c8351bf42bb..ca99993f113296e9d27779213188b40cbb79513e 100644 --- a/contrib/tmpl-completions.nu +++ b/contrib/tmpl-completions.nu @@ -15,8 +15,8 @@ # Template automation export extern "tmpl" [ --registry(-r): string # Registry directory of tmpl (default: ~/.tmpl) [$TMPL_REGISTRY] --source(-s): string # Short-name source to use [$TMPL_SOURCE] - --help(-h) # Show help + --help(-h): bool # Show help - --version(-v) # Show version + --version(-v): bool # Show version ] # Download a template @@ -24,19 +24,19 @@ export extern "tmpl download" [ repo_url: string # Repository URL name: string # Local name for template --branch(-b): string # Branch to clone (default: "main") [$TMPL_BRANCH] - --help(-h) # Show help + --help(-h): bool # Show help ] # Manage tmpl environment variables export extern "tmpl env" [ - --help(-h) # Show help + --help(-h): bool # Show help ] # Set a tmpl environment variable export extern "tmpl env set" [ key: string@"_tmpl_env_keys" # Env key value: string # Env value - --help(-h) # Show help + --help(-h): bool # Show help ] # Unset a tmpl environment variable @@ -46,19 +46,19 @@ ] # Initialize a blank tmpl template export extern "tmpl init" [ - --help(-h) # Show help + --help(-h): bool # Show help ] # List all templates in registry export extern "tmpl list" [ - --json # Output in JSON + --json: bool # Output in JSON - --help(-h) # Show help + --help(-h): bool # Show help ] # Remove a template export extern "tmpl remove" [ name: string # Name of the template to remove - --help(-h) #Show help + --help(-h): bool #Show help ] # Restore templates present in the registry, but missing archives @@ -70,7 +70,7 @@ # Save a local template export extern "tmpl save" [ path: string # Path to the local template name: string # Name of the template - --help(-h) # Show help + --help(-h): bool # Show help ] # Work with tmpl sources @@ -82,20 +82,20 @@ # Add a tmpl source export extern "tmpl source add" [ base_url: string # Base URL name: string # Name - --help(-h) # Show help + --help(-h): bool # Show help ] # Remove a tmpl source export extern "tmpl source remove" [ name: string@"_tmpl_source_list" # Source to remove -def _tmpl_source_list [] { def _tmpl_template_list [] { +# Template automation ] # Test whether a directory is a valid tmpl template export extern "tmpl test" [ path?: string # Path to test (default: ".") - --help(-h) # Show help + --help(-h): bool # Show help ] # Update a template @@ -108,8 +108,8 @@ # Use a template export extern "tmpl use" [ name: string@"_tmpl_template_list" # The template to execute dest?: path # Destination for the template (default: ".") - --defaults # Use template defaults -def _tmpl_template_list [] { + ^tmpl list --json | from json | each { |it| { value: $it.Name, description: (if $it.Path != "" { $it.Path } else { $"($it.Repository)@($it.Branch)" }) } } -def _tmpl_template_list [] { + ^tmpl list --json | from json | each { |it| { value: $it.Name, description: (if $it.Path != "" { $it.Path } else { $"($it.Repository)@($it.Branch)" }) } } def _tmpl_env_keys [] { + --help(-h): bool # Show help ]