diff --git a/changelog.md b/changelog.md index 7fd1c01d..63e010e0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,11 @@ Upcoming (TBD) ============== +Documentation +--------- +* Document the `\g` special command to send a query. + + Internal --------- * Independent case-sensitivity for special command aliases. diff --git a/mycli/packages/special/main.py b/mycli/packages/special/main.py index 1b03d1a6..3c6e3741 100644 --- a/mycli/packages/special/main.py +++ b/mycli/packages/special/main.py @@ -182,7 +182,7 @@ def show_help(*_args) -> list[SQLResult]: header = ["Command", "Shortcut", "Usage", "Description"] result = [] - for _, value in sorted(COMMANDS.items()): + for _, value in sorted(COMMANDS.items(), key=lambda x: str.casefold(x[0])): if value.hidden: continue if value.aliases: @@ -280,6 +280,13 @@ def quit_(*_args): arg_type=ArgType.NO_QUERY, case_sensitive=True, ) +@special_command( + "\\g", + "\\g", + "Display query results (mnemonic: go).", + arg_type=ArgType.NO_QUERY, + case_sensitive=True, +) def stub(): raise NotImplementedError diff --git a/test/features/fixture_data/help_commands.txt b/test/features/fixture_data/help_commands.txt index 248f767f..26a23914 100644 --- a/test/features/fixture_data/help_commands.txt +++ b/test/features/fixture_data/help_commands.txt @@ -1,7 +1,6 @@ +----------------+----------+---------------------------------+-------------------------------------------------------------+ | Command | Shortcut | Usage | Description | +----------------+----------+---------------------------------+-------------------------------------------------------------+ -| \G | | \G | Display query results vertically. | | \bug | | \bug | File a bug on GitHub. | | \clip | | \clip | Copy query to the system clipboard. | | \dt | | \dt[+] [table] | List or describe tables. | @@ -9,6 +8,8 @@ | \f | | \f [name [args..]] | List or execute favorite queries. | | \fd | | \fd | Delete a favorite query. | | \fs | | \fs | Save a favorite query. | +| \g | | \g | Display query results (mnemonic: go). | +| \G | | \G | Display query results vertically. | | \l | | \l | List databases. | | \llm | \ai | \llm [arguments] | Interrogate an LLM. See "\llm help". | | \once | \o | \once [-o] | Append next result to an output file (overwrite using -o). |