r"""A clip command is any query that is prefixed or suffixed by a '\clip'. :param text: Document :return: Boolean
(mycli: 'MyCli', text: str)
| 31 | # todo: maybe these handlers belong in a repl_handlers.py (which does not exist yet) |
| 32 | # \clip doesn't even have a keybinding |
| 33 | def 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 | |
| 51 | def handle_editor_command( |
no test coverage detected