]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-133934: Mention special commands in sqlite3 `.help` message (GH-135224)
authorStan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Thu, 19 Jun 2025 11:47:29 +0000 (12:47 +0100)
committerGitHub <noreply@github.com>
Thu, 19 Jun 2025 11:47:29 +0000 (13:47 +0200)
Lib/sqlite3/__main__.py
Misc/NEWS.d/next/Library/2025-06-06-17-34-18.gh-issue-133934.yT1r68.rst [new file with mode: 0644]

index 9443afbfcc273fd297520768a5c734320eb70cdb..35344ecceff5260527ce6ca8c48e3f3f25c0781c 100644 (file)
@@ -65,7 +65,11 @@ class SqliteInteractiveConsole(InteractiveConsole):
                 case "version":
                     print(sqlite3.sqlite_version)
                 case "help":
-                    print("Enter SQL code and press enter.")
+                    t = theme.syntax
+                    print(f"Enter SQL code or one of the below commands, and press enter.\n\n"
+                          f"{t.builtin}.version{t.reset}    Print underlying SQLite library version\n"
+                          f"{t.builtin}.help{t.reset}       Print this help message\n"
+                          f"{t.builtin}.quit{t.reset}       Exit the CLI, equivalent to CTRL-D\n")
                 case "quit":
                     sys.exit(0)
                 case "":
diff --git a/Misc/NEWS.d/next/Library/2025-06-06-17-34-18.gh-issue-133934.yT1r68.rst b/Misc/NEWS.d/next/Library/2025-06-06-17-34-18.gh-issue-133934.yT1r68.rst
new file mode 100644 (file)
index 0000000..4de7b4c
--- /dev/null
@@ -0,0 +1 @@
+Improve :mod:`sqlite3` CLI's ``.help`` message.