Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shell completions to wrapper #19

Closed
wants to merge 1 commit into from
Closed

Add shell completions to wrapper #19

wants to merge 1 commit into from

Conversation

srid
Copy link
Member

@srid srid commented Dec 20, 2022

bash, fish, zsh supported

Ref #4

bash, fish, zsh supported
@srid srid marked this pull request as draft December 20, 2022 17:14
@srid
Copy link
Member Author

srid commented Dec 20, 2022

This doesn't work on macOS (using the default shell, /bin/zsh).

Copy link
Member Author

@srid srid left a comment

Choose a reason for hiding this comment

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

This PR needs a few changes before being considered for merge:

  1. If zsh completions are not tested to work (especially on macOS, which they do not), they should be removed entirely.
    • Ideally we would fix macOS zsh completion in this PR, but this can also happen in a separate PR.
  2. The entire completion code should be factored out of wrapper.nix into its own file, especially as the fish/zsh completions are looking to be complex. That Nix file should take a list of strings (program name and subcommands) and return the shell completion spec for them.

@@ -48,13 +50,76 @@ let
fi
'';
};
sanitizedWrapperName =
Copy link
Member Author

Choose a reason for hiding this comment

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

Need a comment here explaining why we need this sanitization in the first place. Is it because one or more of the shells can't work with special characters like ,, or?

@srid
Copy link
Member Author

srid commented Jul 26, 2023

Closing. cf. db46f39

@srid srid closed this Jul 26, 2023
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