You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Nickolay Martinov (JIRA)" <ji...@apache.org> on 2011/02/26 12:24:21 UTC
[jira] Created: (EXEC-56) CommandLine toString() might be confusing
for troubleshooting purposes
CommandLine toString() might be confusing for troubleshooting purposes
----------------------------------------------------------------------
Key: EXEC-56
URL: https://issues.apache.org/jira/browse/EXEC-56
Project: Commons Exec
Issue Type: Improvement
Affects Versions: 1.1
Reporter: Nickolay Martinov
Priority: Minor
CommandLine.toString() produces same output for different command lines. This may be very confusing during troubleshooting and may lead to incorrect assumptions. For example, if actual command to invoke was sh -c "echo 1" it might be displayed (in debug output for example) as sh -c echo 1 (that will work incorrectly) and incorrect assumption might be made.
Proposal is to make it clear what every parameter actually is. For example, following code
CommandLine cmd1 = new CommandLine("sh").addArgument("-c").addArgument("echo 1", false);
CommandLine cmd2 = new CommandLine("sh").addArgument("-c").addArgument("echo").addArgument("1");
System.out.println("cmd1: " + cmd1.toString());
System.out.println("cmd2: " + cmd2.toString());
will produce confusing output
cmd1: sh -c echo 1
cmd2: sh -c echo 1
Same time, following output might be more helpful to figure out cause of some problem or to prove that there are no problems with how parameters are set:
cmd1: [sh, -c, echo 1]
cmd2: [sh, -c, echo, 1]
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (EXEC-56) CommandLine toString() might be
confusing for troubleshooting purposes
Posted by "Peter Kofler (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/EXEC-56?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13144804#comment-13144804 ]
Peter Kofler commented on EXEC-56:
----------------------------------
Sorry, somehow my version was old, although I did several times svn up... Forget the patch!
> CommandLine toString() might be confusing for troubleshooting purposes
> ----------------------------------------------------------------------
>
> Key: EXEC-56
> URL: https://issues.apache.org/jira/browse/EXEC-56
> Project: Commons Exec
> Issue Type: Improvement
> Affects Versions: 1.1
> Reporter: Nickolay Martinov
> Assignee: Siegfried Goeschl
> Priority: Minor
> Labels: patch
> Attachments: EXEC-56-tests.patch, EXEC-XXX.toString-troubleshooting.patch
>
>
> CommandLine.toString() produces same output for different command lines. This may be very confusing during troubleshooting and may lead to incorrect assumptions. For example, if actual command to invoke was sh -c "echo 1" it might be displayed (in debug output for example) as sh -c echo 1 (that will work incorrectly) and incorrect assumption might be made.
> Proposal is to make it clear what every parameter actually is. For example, following code
> CommandLine cmd1 = new CommandLine("sh").addArgument("-c").addArgument("echo 1", false);
> CommandLine cmd2 = new CommandLine("sh").addArgument("-c").addArgument("echo").addArgument("1");
> System.out.println("cmd1: " + cmd1.toString());
> System.out.println("cmd2: " + cmd2.toString());
> will produce confusing output
> cmd1: sh -c echo 1
> cmd2: sh -c echo 1
> Same time, following output might be more helpful to figure out cause of some problem or to prove that there are no problems with how parameters are set:
> cmd1: [sh, -c, echo 1]
> cmd2: [sh, -c, echo, 1]
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (EXEC-56) CommandLine toString() might be confusing
for troubleshooting purposes
Posted by "Nickolay Martinov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/EXEC-56?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nickolay Martinov updated EXEC-56:
----------------------------------
Attachment: EXEC-XXX.toString-troubleshooting.patch
Added patch that implements suggestion.
> CommandLine toString() might be confusing for troubleshooting purposes
> ----------------------------------------------------------------------
>
> Key: EXEC-56
> URL: https://issues.apache.org/jira/browse/EXEC-56
> Project: Commons Exec
> Issue Type: Improvement
> Affects Versions: 1.1
> Reporter: Nickolay Martinov
> Priority: Minor
> Labels: patch
> Attachments: EXEC-XXX.toString-troubleshooting.patch
>
>
> CommandLine.toString() produces same output for different command lines. This may be very confusing during troubleshooting and may lead to incorrect assumptions. For example, if actual command to invoke was sh -c "echo 1" it might be displayed (in debug output for example) as sh -c echo 1 (that will work incorrectly) and incorrect assumption might be made.
> Proposal is to make it clear what every parameter actually is. For example, following code
> CommandLine cmd1 = new CommandLine("sh").addArgument("-c").addArgument("echo 1", false);
> CommandLine cmd2 = new CommandLine("sh").addArgument("-c").addArgument("echo").addArgument("1");
> System.out.println("cmd1: " + cmd1.toString());
> System.out.println("cmd2: " + cmd2.toString());
> will produce confusing output
> cmd1: sh -c echo 1
> cmd2: sh -c echo 1
> Same time, following output might be more helpful to figure out cause of some problem or to prove that there are no problems with how parameters are set:
> cmd1: [sh, -c, echo 1]
> cmd2: [sh, -c, echo, 1]
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (EXEC-56) CommandLine toString() might be
confusing for troubleshooting purposes
Posted by "Siegfried Goeschl (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/EXEC-56?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Siegfried Goeschl resolved EXEC-56.
-----------------------------------
Resolution: Fixed
Patch applied at 2011-10-10
> CommandLine toString() might be confusing for troubleshooting purposes
> ----------------------------------------------------------------------
>
> Key: EXEC-56
> URL: https://issues.apache.org/jira/browse/EXEC-56
> Project: Commons Exec
> Issue Type: Improvement
> Affects Versions: 1.1
> Reporter: Nickolay Martinov
> Assignee: Siegfried Goeschl
> Priority: Minor
> Labels: patch
> Attachments: EXEC-56-tests.patch, EXEC-XXX.toString-troubleshooting.patch
>
>
> CommandLine.toString() produces same output for different command lines. This may be very confusing during troubleshooting and may lead to incorrect assumptions. For example, if actual command to invoke was sh -c "echo 1" it might be displayed (in debug output for example) as sh -c echo 1 (that will work incorrectly) and incorrect assumption might be made.
> Proposal is to make it clear what every parameter actually is. For example, following code
> CommandLine cmd1 = new CommandLine("sh").addArgument("-c").addArgument("echo 1", false);
> CommandLine cmd2 = new CommandLine("sh").addArgument("-c").addArgument("echo").addArgument("1");
> System.out.println("cmd1: " + cmd1.toString());
> System.out.println("cmd2: " + cmd2.toString());
> will produce confusing output
> cmd1: sh -c echo 1
> cmd2: sh -c echo 1
> Same time, following output might be more helpful to figure out cause of some problem or to prove that there are no problems with how parameters are set:
> cmd1: [sh, -c, echo 1]
> cmd2: [sh, -c, echo, 1]
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (EXEC-56) CommandLine toString() might be
confusing for troubleshooting purposes
Posted by "Peter Kofler (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/EXEC-56?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter Kofler updated EXEC-56:
-----------------------------
Attachment: EXEC-56-tests.patch
You forgot to update the tests. Build is now failing. See my patch with the fixed tests.
> CommandLine toString() might be confusing for troubleshooting purposes
> ----------------------------------------------------------------------
>
> Key: EXEC-56
> URL: https://issues.apache.org/jira/browse/EXEC-56
> Project: Commons Exec
> Issue Type: Improvement
> Affects Versions: 1.1
> Reporter: Nickolay Martinov
> Assignee: Siegfried Goeschl
> Priority: Minor
> Labels: patch
> Attachments: EXEC-56-tests.patch, EXEC-XXX.toString-troubleshooting.patch
>
>
> CommandLine.toString() produces same output for different command lines. This may be very confusing during troubleshooting and may lead to incorrect assumptions. For example, if actual command to invoke was sh -c "echo 1" it might be displayed (in debug output for example) as sh -c echo 1 (that will work incorrectly) and incorrect assumption might be made.
> Proposal is to make it clear what every parameter actually is. For example, following code
> CommandLine cmd1 = new CommandLine("sh").addArgument("-c").addArgument("echo 1", false);
> CommandLine cmd2 = new CommandLine("sh").addArgument("-c").addArgument("echo").addArgument("1");
> System.out.println("cmd1: " + cmd1.toString());
> System.out.println("cmd2: " + cmd2.toString());
> will produce confusing output
> cmd1: sh -c echo 1
> cmd2: sh -c echo 1
> Same time, following output might be more helpful to figure out cause of some problem or to prove that there are no problems with how parameters are set:
> cmd1: [sh, -c, echo 1]
> cmd2: [sh, -c, echo, 1]
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira