You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Stefan Miklosovic (Jira)" <ji...@apache.org> on 2022/02/07 10:15:00 UTC

[jira] [Comment Edited] (CASSANDRA-17236) Add support for short form of version to CQLSH

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

Stefan Miklosovic edited comment on CASSANDRA-17236 at 2/7/22, 10:14 AM:
-------------------------------------------------------------------------

It just ... works. Not sure what to add. I was wondering what flag we would use for verbose flag if we ever use any, we would be basically forced to use "--verbose" as right now both --v and -v are taken but that is just fine imho.

I am +1, I am running a build. Would you +1 here too, [~brandon.williams]?


was (Author: smiklosovic):
It just ... works. Not sure what to add. I was wondering what flag we would use for verbose flag if we even use any, we would be basically forced to use "--verbose" as right now both --v and -v are taken but that is just fine imho.

I am +1, I am running a build. Would you +1 here too, [~brandon.williams]?

> Add support for short form of version to CQLSH
> ----------------------------------------------
>
>                 Key: CASSANDRA-17236
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17236
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL/Semantics
>            Reporter: Madhavan
>            Assignee: Yash Ladha
>            Priority: Low
>              Labels: lhf
>             Fix For: 4.x
>
>
> Today we do only support the `–version` long option/form for cqlsh and this enhancement Jira is to request that we also offer a shorter version `-v` to cqlsh. This will have consistency benefits with other tools and even match with what we have at `bin/cassandra -v` option for instance.
> Today, `cqlsh` does support `--v` to get the version which is different than the single dashed short form that is available at many other tools. Thanks to Ekaterina for finding this. It looks like this is stemming from Python's parse mechanism which is detailed here, [https://docs.python.org/2.7/library/optparse.html#printing-a-version-string].
>  
> [https://github.com/apache/cassandra/blob/trunk/bin/cqlsh.py#L194-L196]
> {quote}parser = optparse.OptionParser(description=description, epilog=epilog,
>                                usage="Usage: %prog [options] [host [port]]",
>                                version='cqlsh ' + version)
> {quote}
>  
> {{$ bin/cqlsh --v}}
> {{cqlsh 6.0.0}}
> This looks like a weird implementation at Python. Both (\-\-help) and (\-\-version) options are stemming from here, [https://github.com/python/cpython/blob/2.7/Lib/optparse.py#L1248-L1256] and they did decide to ignore the short form option for version and it somehow automatically takes the (--v) option to spit the version info.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org