[
https://issues.apache.org/jira/browse/CASSANDRA-17236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yash Ladha updated CASSANDRA-17236:
-----------------------------------
Test and Documentation Plan: Check the binary using `-v` and `–version`.
Status: Patch Available (was: Open)
https://github.com/apache/cassandra/pull/1439
> 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: [email protected]
For additional commands, e-mail: [email protected]