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

need identifier to mark start of args #285

Open
Chaitanyabsprip opened this issue Dec 3, 2024 · 2 comments
Open

need identifier to mark start of args #285

Chaitanyabsprip opened this issue Dec 3, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@Chaitanyabsprip
Copy link
Contributor

Because bonzai makes it so easy to add subcommands, command name and
arguments conflicts are more probable. I suggest that we some parsing
logic that looks for an identifier that demarcates the end of the
command and start of arguments. This way any conflicts can be avoided.

The case I ran into this is with my note tool having an edit command
and variadic arguments. As the arguments can be any english word, it
would've clashed with the edit command.

@rwxrob
Copy link
Owner

rwxrob commented Dec 8, 2024

I'm not convinced this can't be avoided by avoiding default commands. I'm not inclined to violate "all command lines are speakable" for this. We had a similar situation before with things like help, that can also be arguments so we "burn" one valid argument for the sake of having it have special meaning. I'm open to discussing it, but pretty against it at this point.

@rwxrob rwxrob added the enhancement New feature or request label Dec 8, 2024
@Chaitanyabsprip
Copy link
Contributor Author

My note command is completely in line with the "speakable command lines" idea. I avoid using quotes unless necessary for "noting" the test. For example

$ note this is a very import thought I want to capture. no need to use quotes for all of this to be captured

$ note todo "this is a case that requires quotes because the ? mark can't be used without quotes or escapes"

$ note edit this or that. this case represent the problem I am having with the current impl of bonzai, edit is also a subcommand to open editor, this will do that instead of capturing text

Above examples are valid commands using my note tool. here is where I would need a -- to differentiate between the "edit" as an argument vs as a command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants