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

programmatic shell completions #8043

Merged
merged 2 commits into from
Jul 2, 2021
Merged

programmatic shell completions #8043

merged 2 commits into from
Jul 2, 2021

Conversation

Stebalien
Copy link
Member

These are missing some of the features of the current hand-rolled completions, but they:

  1. Are less buggy.
  2. Cover all commands.
  3. Don't need to be manually maintained (which we never do anyways).

fixes #4551
fixes #8033

@Stebalien Stebalien requested a review from hsanjuan April 1, 2021 07:57
@Stebalien Stebalien force-pushed the feat/completions branch 2 times, most recently from 9052c4e to d1e54d3 Compare April 1, 2021 18:06
@Stebalien
Copy link
Member Author

So... an alternative would be to add a "complete me" command to go-ipfs so you could pass ipfs partial comm to go-ipfs and have it complete comm and return the results.

@aschmahmann aschmahmann self-requested a review May 10, 2021 15:36
@Stebalien Stebalien added this to the go-ipfs 0.10 milestone Jun 25, 2021
@BigLep BigLep requested a review from ribasushi July 1, 2021 15:12
})
sort.Slice(parsed.ShortOptions, func(i, j int) bool {
return parsed.ShortOptions[i] < parsed.ShortOptions[j]
})
Copy link
Contributor

Choose a reason for hiding this comment

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

you can use sort.Strings for all four of these

@mvdan
Copy link
Contributor

mvdan commented Jul 1, 2021

Nothing stands out to me with the shell, but I haven't properly reviewed it - I've never written completion scripts by hand :)

Copy link
Contributor

@ribasushi ribasushi left a comment

Choose a reason for hiding this comment

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

Generally looks great, excellent work!!!!

A bit annoying that the indentation of the various blocks is all over the place / makes it hard to reason about at first look, but this is not really for human consumption anyway.

Left a single suggestion in the "how to use this" section, good to ship as is without considering it.

docs/command-completion.md Outdated Show resolved Hide resolved
These are missing some of the features of the current hand-rolled
completions, but:

1. Are less buggy.
2. Cover _all_ commands.
3. Don't need to be manually maintained (which we never do anyways).

fixes #4551
fixes #8033
@Stebalien Stebalien merged commit ae30699 into master Jul 2, 2021
@Stebalien Stebalien deleted the feat/completions branch July 8, 2021 05:27
@aschmahmann aschmahmann mentioned this pull request Aug 23, 2021
62 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

bash completion doesn't complete files with spaces Feature Request: bash completion generation via a command
3 participants