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

discussion - self-completing commends #5

Open
akdor1154 opened this issue Jan 12, 2024 · 1 comment
Open

discussion - self-completing commends #5

akdor1154 opened this issue Jan 12, 2024 · 1 comment

Comments

@akdor1154
Copy link

heya,

this looks fab! One thing I've been wondering about is some sort of self-documenting/completing mechanism - e.g. some way for bins/scripts to act as their own completer.

having a way to get a usage spec out of a script/bin (e.g. your double-shebang mechanism) is one half, but the other is for the command itself to be recursively involved in completions. Think e.g. a field that wants an s3:// url, or an scp remotehost:/remotepath field. Not fleshed out sorry, I'll come back to this :)

@jdx
Copy link
Owner

jdx commented Jan 12, 2024

yes, this is table-stakes. In fact what I need usage for currently is the ability to "mount" one CLI into another for mise run .... I haven't fully figured out how this will work but right now but in usage-cli I'm thinking the commands to build completions and stuff could accept a command string, e.g.:

$ usage complete-word -x "mycli --usage"

And it would exec mycli --usage, get the dynamic definition, and be able to complete against it.

But it may make sense to configure this by putting it into the spec itself, maybe we could add a param like this:

fetch_spec "mycli --usage"

I don't love that name but something like that.

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

No branches or pull requests

2 participants