Skip to content

feat: add nushell completions #11311

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

0xferrous
Copy link
Contributor

Motivation

Getting command completions in nushell.

Solution

  • clap_complete doesn't come with nushell completions built-in but they have another crate clap_complete_nushell that does. Sucks it isn't supported by default, see Why are the nushell completions not part of the completions crate? clap-rs/clap#5880. This PR implements a wrapper around the enum with nushell included to support nushell completions too.
  • moved clap_complete to workspace dependency to prevent conflicting versions between foundry-common and cast/anvil/forge.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

- `clap_complete` doesn't come with nushell completions built-in but they
  have another crate `clap_complete_nushell` that does. Sucks it isn't
  supported by default, see clap-rs/clap#5880.
  This PR implements a wrapper around the enum with nushell included to
  support nushell completions too.
- moved `clap_complete` to workspace dependency to prevent conflicting
  versions between foundry-common and cast/anvil/forge.
Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

lgtm, smol ask

@0xferrous 0xferrous requested a review from onbjerg August 18, 2025 00:17
@zerosnacks
Copy link
Member

Implementation makes sense though I'm a bit concerned about leaking these internals into Foundry

@0xferrous
Copy link
Contributor Author

0xferrous commented Aug 18, 2025

What is the concern? I guess I can publish a mini crate that wraps this and exposes this functionality so the code stays the same as before? But I think security wise this is probably better to have the code in foundry and trust only the official clap crates.

@zerosnacks
Copy link
Member

That as you stated this logic is a concern of the library and not the implementation. That said, I am OK with merging this considering this is a small ask and the discussion upstream looks stale.

Copy link
Member

@zerosnacks zerosnacks left a comment

Choose a reason for hiding this comment

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

lgtm, pending @grandizzy

Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants