summaryrefslogtreecommitdiffstats
path: root/litecli
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 16:08:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 16:08:28 +0000
commit87689c2e1883711c80c24acf4e2023715a8fac29 (patch)
treedde7494c72f3ca836a24a4a6559b6c350f831cce /litecli
parentAdding upstream version 1.10.1. (diff)
downloadlitecli-upstream.tar.xz
litecli-upstream.zip
Adding upstream version 1.11.0.upstream/1.11.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'litecli')
-rw-r--r--litecli/__init__.py2
-rw-r--r--litecli/liteclirc4
-rw-r--r--litecli/main.py16
-rw-r--r--litecli/packages/special/dbcommands.py2
4 files changed, 13 insertions, 11 deletions
diff --git a/litecli/__init__.py b/litecli/__init__.py
index a0865bb..f84c53b 100644
--- a/litecli/__init__.py
+++ b/litecli/__init__.py
@@ -1 +1 @@
-__version__ = "1.10.1"
+__version__ = "1.11.0"
diff --git a/litecli/liteclirc b/litecli/liteclirc
index 924b585..1184278 100644
--- a/litecli/liteclirc
+++ b/litecli/liteclirc
@@ -122,7 +122,7 @@ output.even-row = ""
# Startup commands
# litecli commands or sqlite commands to be executed on startup.
-# some of them will require you to have a database attached.
+# some of them will require you to have a database attached.
# they will be executed in the same order as they appear in the list.
[startup_commands]
-#commands = ".tables", "pragma foreign_keys = ON;" \ No newline at end of file
+#commands = ".tables", "pragma foreign_keys = ON;"
diff --git a/litecli/main.py b/litecli/main.py
index 268ede2..ebbc5ba 100644
--- a/litecli/main.py
+++ b/litecli/main.py
@@ -10,7 +10,7 @@ from time import time
from datetime import datetime
from io import open
from collections import namedtuple
-from sqlite3 import OperationalError
+from sqlite3 import OperationalError, sqlite_version
import shutil
from cli_helpers.tabular_output import TabularOutputFormatter
@@ -380,10 +380,8 @@ class LiteCli(object):
key_bindings = cli_bindings(self)
if not self.less_chatty:
- print("Version:", __version__)
- print("Mail: https://groups.google.com/forum/#!forum/litecli-users")
+ print(f"LiteCli: {__version__} (SQLite: {sqlite_version})")
print("GitHub: https://github.com/dbcli/litecli")
- # print("Home: https://litecli.com")
def get_message():
prompt = self.get_prompt(self.prompt_format)
@@ -588,7 +586,11 @@ class LiteCli(object):
def startup_commands():
if self.startup_commands:
if "commands" in self.startup_commands:
- for command in self.startup_commands["commands"]:
+ if isinstance(self.startup_commands["commands"], str):
+ commands = [self.startup_commands["commands"]]
+ else:
+ commands = self.startup_commands["commands"]
+ for command in commands:
try:
res = sqlexecute.run(command)
except Exception as e:
@@ -819,7 +821,7 @@ class LiteCli(object):
headers,
format_name="vertical" if expanded else None,
column_types=column_types,
- **output_kwargs
+ **output_kwargs,
)
if isinstance(formatted, (text_type)):
@@ -841,7 +843,7 @@ class LiteCli(object):
headers,
format_name="vertical",
column_types=column_types,
- **output_kwargs
+ **output_kwargs,
)
if isinstance(formatted, (text_type)):
formatted = iter(formatted.splitlines())
diff --git a/litecli/packages/special/dbcommands.py b/litecli/packages/special/dbcommands.py
index dec3507..687c9a4 100644
--- a/litecli/packages/special/dbcommands.py
+++ b/litecli/packages/special/dbcommands.py
@@ -224,7 +224,7 @@ def describe(cur, arg, **_):
arg
)
else:
- raise ArgumentMissing("Table name required.")
+ return list_tables(cur)
log.debug(query)
cur.execute(query)