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

[jira] [Commented] (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=17486520#comment-17486520 ] 

Yash Ladha commented on CASSANDRA-17236:
----------------------------------------

Thanks will take a look into this, sorry for the delayed response.

> 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