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

Added escaping capability within quoted parametters for input. #142

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

abensj
Copy link
Contributor

@abensj abensj commented Aug 28, 2016

When input was read from pipe or file, quoted parameters could not contain quotes themselves and there was no way to escape them. For example if command 'search' should find a window that is named <Some text "that's good" >, it was not possible to do unless changing some of quotes with regex dot to match them.

With this upgrade it is possible to escape quotes with backslash just like in most commonly used programming languages, for example, search "Some text "that's good"" or search 'Some text "that's good"'.

Now escaping works with both types of quotes. Philosophical question though remains whether escapes should work in both types of quotes. There are languages which allow only to escape single quote and backslash only when using single quotes and extended escapes when using double quotes. At the moment since extended escaping is not implemented it maybe does not matter that much and for simplicity same functionality was implemented for both quote types. But maybe if we decide that now, could add comment in code for future.

Theoretically this upgrade should not influence previous functionality anyhow, since quote closing is handled almost the same way as previously.

It was tested only with search command, but it could be possible that other commands could benefit from this upgrade too. It was not tested with newline, tab and similar regex special escapes, but it should work as well, because those are just passed through unchanged.

@abensj
Copy link
Contributor Author

abensj commented Nov 22, 2016

Hi, a while has passed and nothing has been done.

Is this commit not good enough? Is there something that blocks to accept the code? Maybe i could help somehow, if possible.

It is just that when the code is left aside for so long things are starting to be forgotten. There were some more things that i wanted to implement, but before that wanted so the current situation is resolved, so the merging is easier.

@jordansissel
Copy link
Owner

jordansissel commented Nov 24, 2016 via email

@abensj
Copy link
Contributor Author

abensj commented Nov 24, 2016

Ok, I'll take a look at how to write/extend some tests. It will take a while though.

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.

None yet

2 participants