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 expressions in [confirm: …] attribute #2287

Open
alerque opened this issue Jul 31, 2024 · 1 comment
Open

Allow expressions in [confirm: …] attribute #2287

alerque opened this issue Jul 31, 2024 · 1 comment

Comments

@alerque
Copy link

alerque commented Jul 31, 2024

Based on the docs and some tests it doesn't seem possible to use variable substitutions in confirm messages. I would have expected something like this to work:

[confirm("Really do stuff with {{arg}}?")]
action arg:
	@echo Doing stuff with {{arg}}

But it doesn't:

$ just action foo
Really do stuff with {{arg}}? y
Doing stuff with foo
@casey
Copy link
Owner

casey commented Jul 31, 2024

{{…}} interpolations aren't processed in strings. See #11.

But the issue is still valid, since you can't do:

[confirm("Really do stuff with " + arg + "?")]
action arg:
	@echo Doing stuff with {{arg}}

Changing this would require accepting an expression in the confirm attribute, and evaluating it. This is a somewhat involved change, since then the evaluator needs to evaluate expressions inside of attributes, but I think it's reasonable.

@casey casey changed the title [confirm()] attribute does not process variable substitutions Allow expressions in [confirm: …] attribute Jul 31, 2024
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

No branches or pull requests

2 participants