Skip to content

Commit

Permalink
contrib: nushell: also complete available languages with --health (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
poliorcetics authored Jul 28, 2024
1 parent 6eae846 commit 9e55e8a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contrib/completion/hx.nu
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
# so it has not been specified here and will not be proposed in the autocompletion of Nushell.
# The help message won't be overriden though, so it will still be present here

def health_categories [] { ["all", "clipboard", "languages"] }
def health_categories [] {
let languages = ^hx --health languages | detect columns | get Language | filter { $in != null }
let completions = [ "all", "clipboard", "languages" ] | append $languages
return $completions
}

def grammar_categories [] { ["fetch", "build"] }

# A post-modern text editor.
export extern hx [
--help(-h), # Prints help information
--tutor, # Loads the tutorial
--health: string@health_categories = "all", # Checks for potential errors in editor setup
--health: string@health_categories, # Checks for potential errors in editor setup
--grammar(-g): string@grammar_categories, # Fetches or builds tree-sitter grammars listed in `languages.toml`
--config(-c): glob, # Specifies a file to use for configuration
-v, # Increases logging verbosity each use for up to 3 times
Expand Down

0 comments on commit 9e55e8a

Please sign in to comment.