Skip to content

Commit a447c48

Browse files
authored
Merge pull request #1647 from dbcli/RW/further-refine-inline-help-descriptions
Further refine inline help descriptions
2 parents 9c2dfbf + 17449fd commit a447c48

5 files changed

Lines changed: 20 additions & 12 deletions

File tree

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Bug Fixes
2222
Documentation
2323
---------
2424
* Add `help <keyword>` to TIPS.
25+
* Refine inline help descriptions.
2526

2627

2728
1.57.0 (2026/02/25)

mycli/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def register_special_commands(self) -> None:
348348
case_sensitive=True,
349349
)
350350
special.register_special_command(
351-
self.execute_from_file, "source", "source <filename>", "Execute commands from file.", aliases=["\\."]
351+
self.execute_from_file, "source", "source <filename>", "Execute queries from a file.", aliases=["\\."]
352352
)
353353
special.register_special_command(
354354
self.change_prompt_format, "prompt", "prompt <string>", "Change prompt format.", aliases=["\\R"], case_sensitive=True

mycli/packages/special/iocommands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ def set_pager(arg: str, **_) -> list[SQLResult]:
104104
return [SQLResult(status=msg)]
105105

106106

107-
@special_command("nopager", "nopager", "Disable pager, print to stdout.", arg_type=ArgType.NO_QUERY, aliases=["\\n"], case_sensitive=True)
107+
@special_command("nopager", "nopager", "Disable pager; print to stdout.", arg_type=ArgType.NO_QUERY, aliases=["\\n"], case_sensitive=True)
108108
def disable_pager() -> list[SQLResult]:
109109
set_pager_enabled(False)
110110
return [SQLResult(status="Pager disabled.")]
111111

112112

113-
@special_command("\\timing", "\\timing", "Toggle timing of commands.", arg_type=ArgType.NO_QUERY, aliases=["\\t"], case_sensitive=True)
113+
@special_command("\\timing", "\\timing", "Toggle timing of queries.", arg_type=ArgType.NO_QUERY, aliases=["\\t"], case_sensitive=True)
114114
def toggle_timing() -> list[SQLResult]:
115115
global TIMING_ENABLED
116116
TIMING_ENABLED = not TIMING_ENABLED
@@ -555,7 +555,7 @@ def flush_pipe_once_if_written(post_redirect_command: str) -> None:
555555
PIPE_ONCE['stdout_mode'] = None
556556

557557

558-
@special_command("watch", "watch [seconds] [-c] <query>", "Executes the query every [seconds] seconds (by default 5).")
558+
@special_command("watch", "watch [seconds] [-c] <query>", "Execute query every [seconds] seconds (5 by default).")
559559
def watch_query(arg: str, **kwargs) -> Generator[SQLResult, None, None]:
560560
usage = """Syntax: watch [seconds] [-c] query.
561561
* seconds: The interval at the query will be repeated, in seconds.

mycli/packages/special/main.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def quit_(*_args):
208208
@special_command(
209209
"\\edit",
210210
"<query>\\edit | \\edit <filename>",
211-
"Edit query with editor (uses $EDITOR).",
211+
"Edit query with editor (uses $VISUAL or $EDITOR).",
212212
arg_type=ArgType.NO_QUERY,
213213
case_sensitive=True,
214214
aliases=['\\e'],
@@ -221,6 +221,13 @@ def stub():
221221

222222
if LLM_IMPORTED:
223223

224-
@special_command("\\llm", "\\llm [arguments]", "Interrogate an LLM.", arg_type=ArgType.RAW_QUERY, case_sensitive=True, aliases=["\\ai"])
224+
@special_command(
225+
"\\llm",
226+
"\\llm [arguments]",
227+
"Interrogate an LLM. See \"\\llm help\".",
228+
arg_type=ArgType.RAW_QUERY,
229+
case_sensitive=True,
230+
aliases=["\\ai"],
231+
)
225232
def llm_stub():
226233
raise NotImplementedError

test/features/fixture_data/help_commands.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,33 @@
55
| \bug | <nope> | \bug | File a bug on GitHub. |
66
| \clip | <nope> | <query>\clip | Copy query to the system clipboard. |
77
| \dt | <nope> | \dt[+] [table] | List or describe tables. |
8-
| \edit | \e | <query>\edit | \edit <filename> | Edit query with editor (uses $EDITOR). |
8+
| \edit | \e | <query>\edit | \edit <filename> | Edit query with editor (uses $VISUAL or $EDITOR). |
99
| \f | <nope> | \f [name [args..]] | List or execute favorite queries. |
1010
| \fd | <nope> | \fd <name> | Delete a favorite query. |
1111
| \fs | <nope> | \fs <name> <query> | Save a favorite query. |
1212
| \l | <nope> | \l | List databases. |
13-
| \llm | \ai | \llm [arguments] | Interrogate an LLM. |
13+
| \llm | \ai | \llm [arguments] | Interrogate an LLM. See "\llm help". |
1414
| \once | \o | \once [-o] <filename> | Append next result to an output file (overwrite using -o). |
1515
| \pipe_once | \| | \pipe_once <command> | Send next result to a subprocess. |
16-
| \timing | \t | \timing | Toggle timing of commands. |
16+
| \timing | \t | \timing | Toggle timing of queries. |
1717
| connect | \r | connect [database] | Reconnect to the server, optionally switching databases. |
1818
| delimiter | <nope> | delimiter <string> | Change end-of-statement delimiter. |
1919
| exit | \q | exit | Exit. |
2020
| help | \? | help [term] | Show this help, or search for a term on the server. |
21-
| nopager | \n | nopager | Disable pager, print to stdout. |
21+
| nopager | \n | nopager | Disable pager; print to stdout. |
2222
| notee | <nope> | notee | Stop writing results to an output file. |
2323
| nowarnings | \w | nowarnings | Disable automatic warnings display. |
2424
| pager | \P | pager [command] | Set pager to [command]. Print query results via pager. |
2525
| prompt | \R | prompt <string> | Change prompt format. |
2626
| quit | \q | quit | Quit. |
2727
| redirectformat | \Tr | redirectformat <format> | Change the table format used to output redirected results. |
2828
| rehash | \# | rehash | Refresh auto-completions. |
29-
| source | \. | source <filename> | Execute commands from file. |
29+
| source | \. | source <filename> | Execute queries from a file. |
3030
| status | \s | status | Get status information from the server. |
3131
| system | <nope> | system <command> | Execute a system shell commmand. |
3232
| tableformat | \T | tableformat <format> | Change the table format used to output interactive results. |
3333
| tee | <nope> | tee [-o] <filename> | Append all results to an output file (overwrite using -o). |
3434
| use | \u | use <database> | Change to a new database. |
3535
| warnings | \W | warnings | Enable automatic warnings display. |
36-
| watch | <nope> | watch [seconds] [-c] <query> | Executes the query every [seconds] seconds (by default 5). |
36+
| watch | <nope> | watch [seconds] [-c] <query> | Execute query every [seconds] seconds (5 by default). |
3737
+----------------+----------+---------------------------------+-------------------------------------------------------------+

0 commit comments

Comments
 (0)