Tune prompt some more

This commit is contained in:
Pekka Enberg
2023-09-01 21:02:52 +03:00
parent ab96f27c56
commit f954729fd9
3 changed files with 1 additions and 96 deletions

93
Cargo.lock generated
View File

@@ -2,15 +2,6 @@
# It is not intended for manual editing.
version = 3
[[package]]
name = "aho-corasick"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783"
dependencies = [
"memchr",
]
[[package]]
name = "anstream"
version = "0.5.0"
@@ -182,19 +173,6 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d"
[[package]]
name = "env_logger"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
dependencies = [
"humantime",
"is-terminal",
"log",
"regex",
"termcolor",
]
[[package]]
name = "equivalent"
version = "1.0.1"
@@ -272,12 +250,6 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "hermit-abi"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b"
[[package]]
name = "home"
version = "0.5.5"
@@ -287,12 +259,6 @@ dependencies = [
"windows-sys",
]
[[package]]
name = "humantime"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "indexmap"
version = "2.0.0"
@@ -303,17 +269,6 @@ dependencies = [
"hashbrown",
]
[[package]]
name = "is-terminal"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
dependencies = [
"hermit-abi",
"rustix",
"windows-sys",
]
[[package]]
name = "libc"
version = "0.2.147"
@@ -327,7 +282,6 @@ dependencies = [
"anyhow",
"clap",
"dirs",
"env_logger",
"lig_core",
"rustyline",
]
@@ -503,35 +457,6 @@ dependencies = [
"thiserror",
]
[[package]]
name = "regex"
version = "1.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
[[package]]
name = "rustix"
version = "0.38.11"
@@ -628,15 +553,6 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "termcolor"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
dependencies = [
"winapi-util",
]
[[package]]
name = "thiserror"
version = "1.0.47"
@@ -772,15 +688,6 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
"winapi",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"

View File

@@ -18,6 +18,5 @@ path = "main.rs"
anyhow = "1.0.75"
clap = { version = "4.4.0", features = ["derive"] }
dirs = "5.0.1"
env_logger = "0.10.0"
lig_core = { path = "../core" }
rustyline = "12.0.0"

View File

@@ -16,7 +16,6 @@ struct Opts {
}
fn main() -> anyhow::Result<()> {
env_logger::init();
let opts = Opts::parse();
let io = IO::new();
let db = Database::open(Arc::new(io), opts.database.to_str().unwrap())?;
@@ -27,6 +26,7 @@ fn main() -> anyhow::Result<()> {
if history_file.exists() {
rl.load_history(history_file.as_path())?;
}
println!("Welcome to Lig SQL shell!");
loop {
let readline = rl.readline("\x1b[90m>\x1b[0m ");
match readline {
@@ -63,7 +63,6 @@ struct IOInner {
impl lig_core::IO for IO {
fn open(&self, path: &str) -> Result<DatabaseRef> {
println!("Opening database file {}", path);
let file = std::fs::File::open(path)?;
let mut inner = self.inner.borrow_mut();
let db_ref = inner.db_refs;