commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glenn McCall (JIRA)" <>
Subject [jira] [Commented] (CLI-275) Cannot get a full quoted argument through
Date Tue, 22 Aug 2017 01:46:03 GMT


Glenn McCall commented on CLI-275:

Agreed, if the Command Interpreter has processed the quotes and presented an argument in quotes
to CLI, then CLI should retain them.
By not doing so, this creates an awfully confusing scenario for end users trying to explain
those familiar with escaping quoted arguments (to bash for example) to pass quotes to a program
only to have different rules apply for an apache-CLI based program.

Some other scenarios that produce "strange results" when invoked from bash (format is as entered
on command line -> as output from CLI followed by notes explaining the input string in
parenthesis. Correctness or otherwise is as compared to echo when run on bash - why? because
this is how we explain quoting to end users - try your escaped string in echo to see how it
will get passed through to an application. Here is the "strange results list":
"~"  -> ~    (this is correct)
\"~\" -> ~    (INcorrect)
'"~"'  -> ~   (single quote - double quote - tilde - double quote - single quote =>
"'"~"'" -> '~' (double - single - double - tilde - double - single - double => correct
- surprisingly to me, echo produces the same result.)
"'~'" -> '~'  (double-single-tilde-single-double) -> Correct)
'""' -> empty string (single-double-double-single) -> INcorrect)
"''" -> '' (double-single-single-double    ->   single-single   -> Correct)
"\"~\"" -> ~ (double - esc double - tilde - esc double - double -> INcorrect).
"\\"~\\"" -> \~\ (double - esc backslash - double - tilde - esc backslash - double ->

it seems that CLI has some sort of vendetta against double quotes.

> Cannot get a full quoted argument through
> -----------------------------------------
>                 Key: CLI-275
>                 URL:
>             Project: Commons CLI
>          Issue Type: Bug
>            Reporter: Csaba Skrabak
> CLI-185 has been partially fixed but user still cannot pass in an argument like "x" (the
whole argument surrounded by one pair of double quotes.) If user enters \"x\" then the quotes
get eaten (btw. WHY THE HECK?!). But if user enters \"\"x\"\" then both pairs of quotes are
left intact.
> The idea of removing the quotes is plain wrong, should be either forgotten entirely or
the argument should be parsed properly (rather than tinkering from bug to bug with variations
of find/substring call constructs) with the possibility to escape and quote quotation marks.
> Blocks: PHOENIX-3710

This message was sent by Atlassian JIRA

View raw message