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

Overhaul handling of spaces and quotes in arguments #30

Open
shocklateboy92 opened this issue Apr 9, 2020 · 3 comments
Open

Overhaul handling of spaces and quotes in arguments #30

shocklateboy92 opened this issue Apr 9, 2020 · 3 comments
Assignees

Comments

@shocklateboy92
Copy link
Collaborator

I've never used BitBar and don't know if I'm breaking compatibility by doing this, but here's how I think arguments should be parsed.

| arg1=value1 arg2=value\ 2 "arg3=value 3" arg4="value 4" and arg5=value" 5" 'arg 6=value 6'

Should all break down into argN=value N, kind of like how a shell would do. (I don't plan to have any keys with spaces in them, but the argument parser shouldn't care).

Gathering some feedback before I take a crack at implementing it.

@lipido
Copy link
Owner

lipido commented Apr 13, 2020

I think that BitBar allows parameters without quotes. https://github.com/matryer/bitbar/blob/master/README.md
If there are spaces, it seems that OSX bitbar needs double quotes (see "bash" parameter).

I am not sure about passing the parameter value inside quotes... (it seems somehow strange)
"arg3=value 3" and 'arg6=value 6'

@shocklateboy92
Copy link
Collaborator Author

As far as I can tell, the combination of examples I listed above is a strict superset of the BitBar ones.
Hopefully I'll have time to take a crack at implementing a draft soon and we'll see.

As for passing the parameter value inside quotes, I was inspired how a shell splits arguments to a program. I.e.

grep --exclude="some file" ...

and

grep "--exclude=some file" ...

end up getting parsed/normalized to the same thing.

@lipido
Copy link
Owner

lipido commented Apr 16, 2020

Ok, if it is a superset of OSX BitBar, I think that we can go forward.

Given your explanation about shell scripts parameter splitting, you have convinced me (although I never have seen this form!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants