Skip to content

feat(nixopts): display nix options in completion output#220

Merged
water-sucks merged 1 commit intonix-community:mainfrom
Sporif:feat-display-nix-options
Apr 12, 2026
Merged

feat(nixopts): display nix options in completion output#220
water-sucks merged 1 commit intonix-community:mainfrom
Sporif:feat-display-nix-options

Conversation

@Sporif
Copy link
Copy Markdown
Collaborator

@Sporif Sporif commented Apr 11, 2026

- Annotate nix flags and introduce a custom usage function to display them in a dedicated section.
- Stop hiding nix flags so they show up in completion menus.
- Remove the default value text for StringMap options.
- Set a back-quoted name for StringMap options to replace the unclear default of "stringToString".

Though it makes discovering the available nix options much more natural, I'm still not entirely sure this is worth bloating the usage text and completions.

Edit:

  • Stop hiding nix flags so they show up in completion output.
  • Since they would otherwise be visible in the usage text, annotate
    nix flags and introduce a custom usage function to hide them from
    the usage text.

@water-sucks water-sucks self-requested a review April 11, 2026 20:43
@water-sucks
Copy link
Copy Markdown
Collaborator

Displaying all the available Nix arguments in --help output seems like more noise than is needed for that specific section, considering how many options exist just for apply; based just off of vibes, I prefer --help being more terse and the actual available Nix options to be shown in the manpages and in completion output.

The only reason I agree with it being in completion output is for ease of use for the dynamic completion options (i.e. --update-input, etc.). Most of the completions don't actually share too many common prefixes past two letters besides options like --no-* and I think they will be inclined to consult the Nix manual anyway for these kinds of options if they are actually using them, perhaps?

@Sporif
Copy link
Copy Markdown
Collaborator Author

Sporif commented Apr 12, 2026

Ok, the completion output is the more important feature as it doesn't really have an alternative. I'll implement just that then.

- Stop hiding nix flags so they show up in completion output.
- Since they would otherwise be visible in the usage text, annotate
  nix flags and introduce a custom usage function to hide them from
  the usage text.
@Sporif Sporif force-pushed the feat-display-nix-options branch from 03229f2 to 5bf5e12 Compare April 12, 2026 20:19
@Sporif Sporif changed the title feat(nixopts): display nix options in usage text and completions feat(nixopts): display nix options in completions output Apr 12, 2026
@Sporif Sporif changed the title feat(nixopts): display nix options in completions output feat(nixopts): display nix options in completion output Apr 12, 2026
Copy link
Copy Markdown
Collaborator

@water-sucks water-sucks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me :}

@water-sucks water-sucks merged commit fbd6622 into nix-community:main Apr 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants