[
https://issues.apache.org/jira/browse/QPID-5495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13876809#comment-13876809
]
Andrew Stitcher commented on QPID-5495:
---------------------------------------
In the intended use case where the command line comes from the _user's_
application ignoring unknown options is the desired behaviour. This is because
there is no way to know how the application itself is going to process the
command line.
I agree ignoring {{argv\[0\]}} could be confusing, but is the standard
behaviour under unix and windows as it just represents the executable name.
To be clear the intended use here is just to pass the command line the
application receives directly into the Logger, and I think that it is only rare
other applications that might want to do something different.
Of course making the documentation clear, correct and complete is definitely a
good thing, so we should improve that. But I think the actual current behaviour
is correct.
> C++ Messaging Client Logger: which options get processed?
> ---------------------------------------------------------
>
> Key: QPID-5495
> URL: https://issues.apache.org/jira/browse/QPID-5495
> Project: Qpid
> Issue Type: Bug
> Components: C++ Client
> Affects Versions: 0.27
> Reporter: Chuck Rolke
>
> The Logger.h file is unclear about what parts of argc and argv get processed.
> Specifically arg\[0\] in the list is ignored and generally unrecognized args
> are (usually) silently ignored. Consider the following calls:
> {code}
> const char* moArgs[]={"--log-enable", "debug+"};
> Logger::configure(2, moArgs);
> {code}
> In this case the "--log-enable is ignored" and the "debug+" is ignored so
> nothing happens.
> {code}
> const char* moArgs[]={"", "--log-enable", "debug+"};
> Logger::configure(3, moArgs);
> {code}
> This works to enable debug+ as expected.
> {code}
> const char* moArgs[]={"", "--log-enable", "debug+", "fubar"};
> Logger::configure(4, moArgs);
> {code}
> This works to enable debug+ but ignores the weird switch.
> None of these behaviors is really terrible but clearer descriptions of how
> they are intended to be used would be helpful. Consider changing
> Logger::configure from void to bool indicating that all the args were
> processed.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]