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

Auto-generated completion scripts add NuShell support #2778

Closed
2 tasks done
hustcer opened this issue Sep 20, 2021 · 7 comments · Fixed by #4935
Closed
2 tasks done

Auto-generated completion scripts add NuShell support #2778

hustcer opened this issue Sep 20, 2021 · 7 comments · Fixed by #4935
Labels
A-completion Area: completion generator C-enhancement Category: Raise on the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Experience needed to fix: Medium / intermediate

Comments

@hustcer
Copy link

hustcer commented Sep 20, 2021

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Clap Version

3.0.0-beta.4

Describe your use case

Auto-generated completion scripts add NuShell support

Describe the solution you'd like

Auto-generated completion scripts add NuShell support, just as clap support (Bash, Zsh, Fish, Elvish and PowerShell), Thx

Alternatives, if applicable

No response

Additional Context

nu --version
───┬────────────────────┬────────────────────────────────────────────────────────────────────────────────────
 # │      Column0       │                                      Column1
───┼────────────────────┼────────────────────────────────────────────────────────────────────────────────────
 0 │ version            │ 0.37.0
 1 │ build_os           │ macos-x86_64
 2 │ rust_version       │ rustc 1.55.0
 3 │ cargo_version      │ cargo 1.55.0
 4 │ pkg_version        │ 0.37.0
 5 │ build_time         │ 2021-09-14 19:45:30 +00:00
 6 │ build_rust_channel │ release
 7 │ features           │ clipboard-cli, ctrlc, dataframe, default, rustyline, term, trash, uuid, which, zip
 8 │ installed_plugins  │
───┴────────────────────┴────────────────────────────────────────────────────────────────────────────────────
@epage
Copy link
Member

epage commented Sep 20, 2021

Somewhat unrelated but I wonder what the code size / compile time looks like for all of our generators and if there is anything we can help developers with development time as our generators expand in number of targets and capabilities.

@pksunkara
Copy link
Member

That was the intention for extra generators. For the basic common ones, we have them in the package itself, but if we were to implement this, we would create a new package called clap_generator_nushell or something.

One thing I am not sure if we can do in Rust because of these new const stuff is, can a user extend the Shell enum through 3rd party code (traits)?

@epage
Copy link
Member

epage commented Sep 20, 2021

A user could manually impl ArgEnum and flatten Shell into their enum or we could add flatten support but I'm not aware of a language feature that would help.

@epage epage added C-enhancement Category: Raise on the bar on expectations E-medium Call for participation: Experience needed to fix: Medium / intermediate and removed T: new feature labels Dec 8, 2021
@epage
Copy link
Member

epage commented Dec 13, 2021

If nushell works like bash where you have to write your own parser, #3166 could be a big help towards this.

@epage epage added the E-help-wanted Call for participation: Help is requested to fix this issue. label Jun 16, 2022
@TornaxO7
Copy link

May I ask, what the state of this issue is?

@jokeyrhyme
Copy link

I'm a huge fan of nushell, but it seems to be in a state of flux (going off the last couple of releases): https://www.nushell.sh/blog/

How likely is it that there are significant changes in the syntax or other workings relating to completion over on the nushell side?

@epage
Copy link
Member

epage commented May 20, 2023

Looks like someone created https://github.com/nibon7/clap_complete_nushell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion Area: completion generator C-enhancement Category: Raise on the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Experience needed to fix: Medium / intermediate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants