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

printf feature request #439

Open
SamuelMarks opened this issue Aug 23, 2024 · 1 comment
Open

printf feature request #439

SamuelMarks opened this issue Aug 23, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@SamuelMarks
Copy link

SamuelMarks commented Aug 23, 2024

Feature Description

It would be great to have a printf. I'm doing fancy escaping stuff where I want to evaluate a variable and quote it so PostgreSQL can execute the query correctly.

Describe The Solution You'd Like

At least basic printf syntax

Code Sample

printf '%s \'%s\' "%s"' 'foo haz' "${can}" bar

Alternatives like std::string::Concat are unfriendly:

$ duck
a = set 5
c = concat '"' ${a} '"'
echo ${c}
'"'5'"'
q = set '
e = concat ${q} ${a} ${q}
echo ${e}
'5'
@sagiegurari
Copy link
Owner

@SamuelMarks good idea. would you like to PR it?

@sagiegurari sagiegurari added the enhancement New feature or request label Aug 30, 2024
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

No branches or pull requests

2 participants