-
Notifications
You must be signed in to change notification settings - Fork 118
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
Convert ANSI-C quoted strings to their value #346
Comments
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
… On Tue, Mar 2, 2021 at 11:16 AM Gitcoin.co Bot ***@***.***> wrote:
@orderr66 <https://github.com/orderr66> Hello from Gitcoin Core - are you
still working on this issue? Please submit a WIP PR or comment back within
the next 3 days or you will be removed from this ticket and it will be
returned to an ‘Open’ status. Please let us know if you have questions!
- reminder (3 days)
- escalation to mods (6 days)
Funders only: Snooze warnings for 1 day
<https://gitcoin.co/issue/yargs/yargs-parser/346/100024881?snooze=1> | 3
days <https://gitcoin.co/issue/yargs/yargs-parser/346/100024881?snooze=3>
| 5 days
<https://gitcoin.co/issue/yargs/yargs-parser/346/100024881?snooze=5> | 10
days <https://gitcoin.co/issue/yargs/yargs-parser/346/100024881?snooze=10>
| 100 days
<https://gitcoin.co/issue/yargs/yargs-parser/346/100024881?snooze=100>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#346 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASC6KFZTTFIV57GQWL55VNDTBUMNBANCNFSM4VTQWV3A>
.
|
This comment was marked as spam.
This comment was marked as spam.
1 similar comment
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
I don't know this problem space super well, but it seems that @aduh95's concern on Node.js is that this syntax is only in the bash shell? I'm concerned mainly because this would be a breaking change -- and I wonder if it's something that would be better handled in user-land -- I'm on the fence mind you, potentially open to the feature. |
One thought, why don't we just add a config option for the feature, |
@bcoe please ignore the Node issue, I didn't understand how exec works. The reason the issue was closed in Node is because it has nothing to do with Node's exec(
"printf '%s' $'hello'",
{ shell: '/bin/bash' },
) then bash parses the
In bash, if you try to print
You can use ANSI-C quoting to convert backslashed characters to the actual character that you can't really input in the terminal
Assuming the parsing is correct, then not exactly but it's not completely transparently backwards compatible either. If someone has already written code that parses these quotes, then now that they are parsed by yargs, and since regular
Where does that go, is this something you like pass to parse("echo -n $'my \\n string'", { shell: 'bash' }) and have Also, thanks for muting @gitcoinbot. |
I added some skipped tests to my PR that exhaustively try to compare all possible literals like I also see now that there's no real good place in the signature for |
This makes sense:
This could be better:
In bash, strings of the form
$'string'
are a special type of string:See https://www.gnu.org/software/bash/manual/bash.html#ANSI_002dC-Quoting
It would be helpful if yargs returned the raw value for these types of strings as well, instead of making the user parse it themselves.
The text was updated successfully, but these errors were encountered: