You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Harsh J (Created) (JIRA)" <ji...@apache.org> on 2012/01/26 17:56:38 UTC

[jira] [Created] (HADOOP-7995) GenericOptionsParser ought to have better options parsing, and not pick only the options in the front

GenericOptionsParser ought to have better options parsing, and not pick only the options in the front
-----------------------------------------------------------------------------------------------------

                 Key: HADOOP-7995
                 URL: https://issues.apache.org/jira/browse/HADOOP-7995
             Project: Hadoop Common
          Issue Type: Improvement
          Components: util
    Affects Versions: 0.23.0
            Reporter: Harsh J
            Priority: Minor


The ToolRunner provided GenericOptionsParser stops parsing known options when it encounters the first unknown option string in the String[] today.

Ideally we should have it be more intelligent and sift through the whole array to pick up all opts, and not just the opts that are at the front of the invoked CLI.

--
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] [Commented] (HADOOP-7995) GenericOptionsParser ought to have better options parsing, and not pick only the options in the front

Posted by "Daryn Sharp (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13208602#comment-13208602 ] 

Daryn Sharp commented on HADOOP-7995:
-------------------------------------

Here's a few examples of how conflicts may occur if the generic options can appear anywhere in the cmdline:
* du -D dir
* ln -fs path

@Harsh
Do you feel this is compelling enough to close the jira?
                
> GenericOptionsParser ought to have better options parsing, and not pick only the options in the front
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-7995
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7995
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 0.23.0
>            Reporter: Harsh J
>            Priority: Minor
>              Labels: newbie
>
> The ToolRunner provided GenericOptionsParser stops parsing known options when it encounters the first unknown option string in the String[] today.
> Ideally we should have it be more intelligent and sift through the whole array to pick up all opts, and not just the opts that are at the front of the invoked CLI.

--
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] [Commented] (HADOOP-7995) GenericOptionsParser ought to have better options parsing, and not pick only the options in the front

Posted by "Daryn Sharp (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194889#comment-13194889 ] 

Daryn Sharp commented on HADOOP-7995:
-------------------------------------

I feel this is a very bad idea...  It will interfere with FsShell's parsing of arguments.
                
> GenericOptionsParser ought to have better options parsing, and not pick only the options in the front
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-7995
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7995
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 0.23.0
>            Reporter: Harsh J
>            Priority: Minor
>              Labels: newbie
>
> The ToolRunner provided GenericOptionsParser stops parsing known options when it encounters the first unknown option string in the String[] today.
> Ideally we should have it be more intelligent and sift through the whole array to pick up all opts, and not just the opts that are at the front of the invoked CLI.

--
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] [Commented] (HADOOP-7995) GenericOptionsParser ought to have better options parsing, and not pick only the options in the front

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194892#comment-13194892 ] 

Harsh J commented on HADOOP-7995:
---------------------------------

Hi,

I filed this from a discussion with {{mischat}} on IRC. We can close it out if there's a strong reason behind not doing this today.

Its an annoyance but not a bug.
                
> GenericOptionsParser ought to have better options parsing, and not pick only the options in the front
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-7995
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7995
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 0.23.0
>            Reporter: Harsh J
>            Priority: Minor
>              Labels: newbie
>
> The ToolRunner provided GenericOptionsParser stops parsing known options when it encounters the first unknown option string in the String[] today.
> Ideally we should have it be more intelligent and sift through the whole array to pick up all opts, and not just the opts that are at the front of the invoked CLI.

--
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] [Resolved] (HADOOP-7995) GenericOptionsParser ought to have better options parsing, and not pick only the options in the front

Posted by "Harsh J (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J resolved HADOOP-7995.
-----------------------------

    Resolution: Won't Fix

Yes Daryn, that is good enough to close this one out and use as a reference for similar future requests.
                
> GenericOptionsParser ought to have better options parsing, and not pick only the options in the front
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-7995
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7995
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 0.23.0
>            Reporter: Harsh J
>            Priority: Minor
>              Labels: newbie
>
> The ToolRunner provided GenericOptionsParser stops parsing known options when it encounters the first unknown option string in the String[] today.
> Ideally we should have it be more intelligent and sift through the whole array to pick up all opts, and not just the opts that are at the front of the invoked CLI.

--
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] [Commented] (HADOOP-7995) GenericOptionsParser ought to have better options parsing, and not pick only the options in the front

Posted by "Daryn Sharp (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194920#comment-13194920 ] 

Daryn Sharp commented on HADOOP-7995:
-------------------------------------

I can certainly see how the idea seems attractive on the surface.  In fact I contemplated it during the  {{FsShell}} redesign, but parsing all arguments for generic options may:
* lead to option conflicts, especially if we move to extended option parsing that uses the least ambiguous shortening of an option, or if we allow option bundling.  Ex. if a subcommand interprets "-fs" as "-f -s", the generic parser will eat the option as its own "-fs"
* fouling of the subcommand behavior if someone happened to have a path that matched a generic option

I'd vote to close this jira.
                
> GenericOptionsParser ought to have better options parsing, and not pick only the options in the front
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-7995
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7995
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 0.23.0
>            Reporter: Harsh J
>            Priority: Minor
>              Labels: newbie
>
> The ToolRunner provided GenericOptionsParser stops parsing known options when it encounters the first unknown option string in the String[] today.
> Ideally we should have it be more intelligent and sift through the whole array to pick up all opts, and not just the opts that are at the front of the invoked CLI.

--
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