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

alias: add auto-escaping special variable #1190

Closed
wants to merge 1 commit into from

Conversation

foghawk
Copy link

@foghawk foghawk commented May 13, 2018

Resolves #1140.

The new special variable $& expands to all arguments supplied to alias, except that double quotes are escaped with backslashes. This means that arbitrary text can be passed into (e.g.) /exec, with alias rather than the user handling escaping.

(I thought about using $@, for 'like $* but does something different related to quotes', but figured that might be misleading given the difference in 'something'.)

@flashcode flashcode added the feature New feature request label May 13, 2018
@flashcode flashcode self-assigned this May 18, 2023
@flashcode flashcode added this to the 4.0.0 milestone May 18, 2023
@flashcode flashcode closed this in de3ee17 May 18, 2023
@flashcode
Copy link
Member

Thanks, merged.

I also refactored alias replace functions to use dynamic string, making code much simple and less error-prone with the malloc and realloc functions.

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

Successfully merging this pull request may close these issues.

alias: allow arbitrary text to be passed from arguments into /exec
2 participants