MCPcopy Create free account
hub / github.com/dbcli/mycli / handle_clip_command

Function handle_clip_command

mycli/packages/key_binding_utils.py:33–48  ·  view source on GitHub ↗

r"""A clip command is any query that is prefixed or suffixed by a '\clip'. :param text: Document :return: Boolean

(mycli: 'MyCli', text: str)

Source from the content-addressed store, hash-verified

31# todo: maybe these handlers belong in a repl_handlers.py (which does not exist yet)
32# \clip doesn't even have a keybinding
33def handle_clip_command(mycli: 'MyCli', text: str) -> bool:
34 r"""A clip command is any query that is prefixed or suffixed by a
35 '\clip'.
36
37 :param text: Document
38 :return: Boolean
39
40 """
41
42 if special.clip_command(text):
43 query = special.get_clip_query(text) or mycli.get_last_query()
44 message = special.copy_query_to_clipboard(sql=query)
45 if message:
46 raise RuntimeError(message)
47 return True
48 return False
49
50
51def handle_editor_command(

Callers 1

_one_iterationFunction · 0.90

Calls 1

get_last_queryMethod · 0.45

Tested by

no test coverage detected