-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add suggestions support (#977) #1390
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
Merged
Merged
+335
−11
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The new option `app.Suggest` enables command and flag suggestions via the jaro-winkler distance algorithm. Flags are scoped to their appropriate commands whereas command suggestions are scoped to the current command level. Signed-off-by: Sascha Grunert <sgrunert@suse.com>
… saschagrunert-suggestions
and further reduce example output diff potential
@meatballhat what is the size difference with and without suggestions? |
dearchap
reviewed
May 12, 2022
@kolyshkin regarding size difference $ go run ./internal/build/build.go check-binary-size
# ---> /usr/sbin/git rev-parse --show-toplevel
# ---> /home/me/.gimme/versions/go1.18.1.linux.amd64/bin/go build -tags -o ./internal/example-cli/built-example -ldflags -s -w ./internal/example-cli/example-cli.go
# ---> /home/me/.gimme/versions/go1.18.1.linux.amd64/bin/go build -tags -o ./internal/example-hello-world/built-example -ldflags -s -w ./internal/example-hello-world/example-hello-world.go
1.7MB is the current binary size
✅ 1.7MB is the target min size
✅ 2.2MB is the target max size $ go run ./internal/build/build.go --tags urfave_cli_no_suggest check-binary-size
# ---> /usr/sbin/git rev-parse --show-toplevel
# ---> /home/me/.gimme/versions/go1.18.1.linux.amd64/bin/go build -tags urfave_cli_no_suggest -o ./internal/example-cli/built-example -ldflags -s -w ./internal/example-cli/example-cli.go
# ---> /home/me/.gimme/versions/go1.18.1.linux.amd64/bin/go build -tags urfave_cli_no_suggest -o ./internal/example-hello-world/built-example -ldflags -s -w ./internal/example-hello-world/example-hello-world.go
1.7MB is the current binary size
✅ 1.7MB is the target min size
✅ 2.2MB is the target max size (small enough that it's not showing up?) $ du internal/example-cli/built-example*
2852 internal/example-cli/built-example
2844 internal/example-cli/built-example-no-suggest |
meatballhat
added a commit
that referenced
this pull request
May 14, 2022
The size difference seems to be about 0.1% (a few kilobytes), so it probably does not make sense to add a build tag for this. |
meatballhat
added a commit
that referenced
this pull request
May 17, 2022
This was referenced Feb 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/v2
relates to / is being considered for v2
kind/feature
describes a code enhancement / feature request
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What this PR does / why we need it:
See #977
Which issue(s) this PR fixes:
Closes #895
Special notes for your reviewer:
This is intended to carry forward the work in #977 with the addition of build tags to allow opting out of the suggestions dependency at build time as with recently-added work for markdown/man doc dependencies (cc @kolyshkin).