Skip to content

gocomplete: update version completion - #160

Open
scop wants to merge 1 commit into
posener:masterfrom
scop:feat/gocomplete-version
Open

gocomplete: update version completion#160
scop wants to merge 1 commit into
posener:masterfrom
scop:feat/gocomplete-version

Conversation

@scop

@scop scop commented Aug 6, 2026

Copy link
Copy Markdown

No description provided.

Comment thread gocomplete/complete.go
Comment on lines +493 to +498
Flags: map[string]complete.Predictor{
"m": predict.Nothing,
"v": predict.Nothing,
"json": predict.Nothing,
},
Args: predict.Files(""),

@scop scop Aug 6, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'm new to this library and gocomplete, noticed gocomplete is quite outdated, and thought I'd see if/how it could be improved. Thought I'd smart small, here goes update for version.

It has a problem though: if one gives any of the supported flags, then the positional file arguments are no longer offered. If I use predict.Files("") for the Flags map values, then the lib offers files after a flag, but understandably as if they were arguments to the flag -- no other flags are offered.

This is not a unique problem with this addition, several existing commands with Flags having predict.Nothing values have the same problem.

Is this something that could be done some other way to avoid the problem, or is it a limitation of the library? I.e. can I somehow say "this is a flag that takes no arguments" without it affecting other flags or positional arguments?

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.

1 participant