Skip to content

Commit

Permalink
Refactor cqlshmain global constants
Browse files Browse the repository at this point in the history
patch by Brad Schoening; reviewed by Stefan Miklosovic and Brandon Williams for CASSANDRA-19201
  • Loading branch information
bschoening authored and smiklosovic committed Feb 20, 2024
1 parent 087a447 commit 1163dd9
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 151 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
@@ -1,4 +1,5 @@
5.1
* Refactor cqlshmain global constants (CASSANDRA-19201)
* Remove native_transport_port_ssl (CASSANDRA-19397)
* Make nodetool reconfigurecms sync by default and add --cancel to be able to cancel ongoing reconfigurations (CASSANDRA-19216)
* Expose auth mode in system_views.clients, nodetool clientstats, metrics (CASSANDRA-19366)
Expand Down
14 changes: 13 additions & 1 deletion pylib/cqlshlib/cqlshhandling.py
Expand Up @@ -16,7 +16,7 @@

import os

from cqlshlib import cqlhandling
from cqlshlib import cqlhandling, cql3handling

# we want the cql parser to understand our cqlsh-specific commands too
my_commands_ending_with_newline = (
Expand Down Expand Up @@ -251,6 +251,18 @@ def registrator(f):
cqlsh_question_mark


def get_cqlshruleset():
cqlruleset = cql3handling.CqlRuleSet
cqlruleset.append_rules(cqlsh_extra_syntax_rules)
for rulename, termname, func in cqlsh_syntax_completers:
cqlruleset.completer_for(rulename, termname)(func)
cqlruleset.commands_end_with_newline.update(my_commands_ending_with_newline)
return cqlruleset


cqlshruleset = get_cqlshruleset()


def complete_source_quoted_filename(ctxt, cqlsh):
partial_path = ctxt.get_binding('partial', '')
head, tail = os.path.split(partial_path)
Expand Down

0 comments on commit 1163dd9

Please sign in to comment.