cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Ellis (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-5340) use getopts instead of getopt in shell script
Date Sat, 23 Mar 2013 04:21:15 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-5340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13611569#comment-13611569
] 

Jonathan Ellis commented on CASSANDRA-5340:
-------------------------------------------

We're happy to review your patch; otherwise, I think most of the active contributors are busy
enough without re-writing working code.
                
> use getopts instead of getopt in shell script
> ---------------------------------------------
>
>                 Key: CASSANDRA-5340
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5340
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>         Environment: Windows XP msysgit GNU bash 3.1.0
>            Reporter: Amichai Rothman
>            Priority: Minor
>
> I don't know what the officially supported platforms are or what versions of sh they
support... however I do know that the cassandra startup script fails on at least one platform
(Windows XP/msysgit) since it uses the external utility getopt which is not available there.
Using the shell built-in getopts command instead, or parsing the command line manually, would
fix the problem.
> I'm no shell expert, but a little searching came up with the fact that the getopt utility
is not required by POSIX (which a script comment claims needs to be adhered to) whereas getopts
is standard and more portable. Some claim getopt is better when long option names need to
be supported, however cassandra doesn't use those anyway.
> Unless someone knows of a supported platform that doesn't support getopts, the script
should be changed to use it instead of getopt. If such a platform exists, perhaps using neither
(manually parsing args) should be considered - it's not too much work, and there are plenty
of existing templates for doing this to build on, and that would provide the best portability
across platforms.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message