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

Allow ending parameter token #194

Closed
nazdridoy opened this issue Oct 17, 2022 · 6 comments · Fixed by #201
Closed

Allow ending parameter token #194

nazdridoy opened this issue Oct 17, 2022 · 6 comments · Fixed by #201
Assignees
Labels
✨ enhancement New feature or request

Comments

@nazdridoy
Copy link

Also allow ending parameter token, so that name parameter can be defined without needing to have white space at the end.

for example sudo find / -iname "*#string*"
here hoard replaces everything after "#" unless you put a space after "#string".
Possible solution, we can define another parameter token like "@" or use same token twice for ending.
sudo find / -iname "*#string@*" sudo find / -iname "*#string##*"

#151

@Hyde46 Hyde46 self-assigned this Oct 20, 2022
@Hyde46 Hyde46 added the ✨ enhancement New feature or request label Oct 20, 2022
@Hyde46
Copy link
Owner

Hyde46 commented Oct 20, 2022

Good point!
I like the same parameter token suffix rule as an additional option to mark the ending of a parameter to replace!

@Hyde46
Copy link
Owner

Hyde46 commented Oct 20, 2022

After giving it some thought, I'd prefer a separate terminating token.
In a case like cmd #first#second it's too ambiguous whether #first# is a single command, and second part of the command, or #first and #second being two separate commands.
For now i'll go with ! as a terminating name token, only relevant if preceeded by # and a random string of characters without a space.

@nazdridoy
Copy link
Author

I think that'd be perfect. Btw, If you could add an escape character like \, it'd be very useful. Then we will be able to escape \#, \! or itself \\ if we need to. Having a escape character can potentially become a simple escape route form many syntax errors.

@nazdridoy
Copy link
Author

nazdridoy commented Oct 20, 2022

possible new rules:

  1. If there is a \ ignore the special behavior of the next character (disabling \ # and !).
  2. If a # is found without escape look for ! and substitute #foo bar foobar! with user input foo bar enabling multi-word named token (more readability)
  3. if no ! after # or no # before ! ignore their special behavior. ( for redundancy, fail safe and convenience)

@Hyde46
Copy link
Owner

Hyde46 commented Oct 22, 2022

Now part of release 1.1.1 🚀
Thanks for the suggestion. Will add escaping characters for the next smaller release

@nazdridoy
Copy link
Author

possible new rules:

  1. If there is a \ ignore the special behavior of the next character (disabling \ # and !).
  2. If a # is found without escape look for ! and substitute #foo bar foobar! with user input foo bar enabling multi-word named token (more readability)
  3. if no ! after # or no # before ! ignore their special behavior. ( for redundancy, fail safe and convenience)

#200

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

Successfully merging a pull request may close this issue.

2 participants