Commit 8007c28b authored by AdminXVII's avatar AdminXVII Committed by Michael Aaron Murphy
Browse files

fix: Update dependencies & fix liner

parent b2811969
......@@ -181,7 +181,7 @@ dependencies = [
[[package]]
name = "bytecount"
version = "0.3.2"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
......@@ -200,15 +200,15 @@ dependencies = [
[[package]]
name = "calculate"
version = "0.7.0"
source = "git+https://gitlab.redox-os.org/redox-os/calc#662bb5441cb9737a94acf87170a5d3755919435a"
source = "git+https://gitlab.redox-os.org/redox-os/calc#1da4d1b970c8a94fcd8b299829661ab693d6d764"
dependencies = [
"atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
"decimal 2.0.4 (git+https://github.com/alkis/decimal.git)",
"failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"liner 0.5.0 (git+https://gitlab.redox-os.org/redox-os/liner)",
"num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_liner 0.5.1 (git+https://gitlab.redox-os.org/redox-os/liner)",
]
[[package]]
......@@ -324,7 +324,7 @@ dependencies = [
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
"criterion-plot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"csv 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -344,7 +344,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
......@@ -806,9 +806,8 @@ dependencies = [
"errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ion-ranges 0.1.0",
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lexical 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liner 0.5.0 (git+https://gitlab.redox-os.org/redox-os/liner)",
"nix 0.15.0 (git+https://github.com/AdminXVII/nix?branch=add-redox-support)",
"object-pool 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"permutate 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -816,6 +815,7 @@ dependencies = [
"piston2d-sprite 0.58.0 (registry+https://github.com/rust-lang/crates.io-index)",
"piston_window 0.105.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_liner 0.5.1 (git+https://gitlab.redox-os.org/redox-os/liner)",
"redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"scopes 0.1.0",
......@@ -832,7 +832,7 @@ dependencies = [
[[package]]
name = "itertools"
version = "0.8.0"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -911,17 +911,6 @@ dependencies = [
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "liner"
version = "0.5.0"
source = "git+https://gitlab.redox-os.org/redox-os/liner#3f3d1d4e6058067e9d03a9b1510d8f2edac073c7"
dependencies = [
"bytecount 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"termion 1.5.3 (git+https://gitlab.redox-os.org/redox-os/termion)",
"unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "lock_api"
version = "0.1.5"
......@@ -1629,6 +1618,17 @@ name = "read_color"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "redox_liner"
version = "0.5.1"
source = "git+https://gitlab.redox-os.org/redox-os/liner#6a6ddaf8cbedcdc8ca9d3d4842d182e8b523116b"
dependencies = [
"bytecount 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"termion 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "redox_syscall"
version = "0.1.56"
......@@ -1934,8 +1934,8 @@ dependencies = [
[[package]]
name = "termion"
version = "1.5.3"
source = "git+https://gitlab.redox-os.org/redox-os/termion#c27678efc2ed14576361c7ce6d806a6bb576f1a9"
version = "1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
"numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -1983,7 +1983,7 @@ dependencies = [
name = "types-rs"
version = "0.1.0"
dependencies = [
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lexical 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"small 0.1.0 (git+https://gitlab.redox-os.org/redox-os/small)",
]
......@@ -2184,6 +2184,11 @@ name = "xml-rs"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[patch.unused]]
name = "termion"
version = "1.5.3"
source = "git+https://gitlab.redox-os.org/redox-os/termion#c27678efc2ed14576361c7ce6d806a6bb576f1a9"
[metadata]
"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2"
"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d"
......@@ -2206,7 +2211,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "5850aeee1552f495dd0250014cf64b82b7c8879a89d83b33bbdace2cc4f63182"
"checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
"checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245"
"checksum bytecount 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f861d9ce359f56dbcb6e0c2a1cb84e52ad732cadb57b806adeb3c7668caccbd8"
"checksum bytecount 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0017894339f586ccb943b01b9555de56770c11cda818e7e3d8bd93f4ed7f46e"
"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"
"checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb"
"checksum calculate 0.7.0 (git+https://gitlab.redox-os.org/redox-os/calc)" = "<none>"
......@@ -2274,7 +2279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4be8aaefbe7545dc42ae925afb55a0098f226a3fe5ef721872806f44f57826"
"checksum inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff"
"checksum interpolation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b7357d2bbc5ee92f8e899ab645233e43d21407573cceb37fed8bc3dede2c02"
"checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358"
"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484"
"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f"
"checksum jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c1aae18ffeeae409c6622c3b6a7ee49792a7e5a062eea1b135fbb74e301792ba"
"checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
......@@ -2285,7 +2290,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8"
"checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753"
"checksum line_drawing 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9"
"checksum liner 0.5.0 (git+https://gitlab.redox-os.org/redox-os/liner)" = "<none>"
"checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c"
"checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc"
"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
......@@ -2365,6 +2369,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "98dcf634205083b17d0861252431eb2acbfb698ab7478a2d20de07954f47ec7b"
"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
"checksum read_color 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9f4c8858baa4ad3c8bcc156ae91a0ffe22b76a3975c40c49b4f04c15c6bce0da"
"checksum redox_liner 0.5.1 (git+https://gitlab.redox-os.org/redox-os/liner)" = "<none>"
"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
"checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d"
......@@ -2403,7 +2408,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
"checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf"
"checksum synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f085a5855930c0441ca1288cf044ea4aecf4f43a91668abdb870b4ba546a203"
"checksum termion 1.5.3 (git+https://gitlab.redox-os.org/redox-os/termion)" = "<none>"
"checksum termion 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "818ef3700c2a7b447dca1a1dd28341fe635e6ee103c806c636bb9c929991b2cd"
"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
"checksum tiff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b7c2cfc4742bd8a32f2e614339dd8ce30dbcf676bb262bd63a2327bc5df57d"
......
......@@ -61,7 +61,7 @@ path = "src/main.rs"
calculate = { git = "https://gitlab.redox-os.org/redox-os/calc" }
err-derive = "0.1"
glob = "0.3"
liner = { git = "https://gitlab.redox-os.org/redox-os/liner" }
redox_liner = { git = "https://gitlab.redox-os.org/redox-os/liner" }
rand = "0.7"
regex = { version = "1.3", default-features = false, features = ["std", "perf"] }
small = { git = "https://gitlab.redox-os.org/redox-os/small", features = ["std"] }
......@@ -105,4 +105,4 @@ panic = "abort"
# Required to make `cargo vendor` work
[patch.crates-io]
termion = { git = "https://gitlab.redox-os.org/redox-os/termion" }
liner = { git = "https://gitlab.redox-os.org/redox-os/liner" }
redox_liner = { git = "https://gitlab.redox-os.org/redox-os/liner" }
......@@ -3,10 +3,11 @@ use ion_shell::{
expansion::{self, Expander},
IonError, PipelineError,
};
use liner::Prompt;
impl<'a> InteractiveShell<'a> {
/// Generates the prompt that will be used by Liner.
pub fn prompt(&self) -> String {
pub fn prompt(&self) -> Prompt {
let mut shell = self.shell.borrow_mut();
let previous_status = shell.previous_status();
let blocks = if self.terminated.get() { shell.block_len() } else { shell.block_len() + 1 };
......@@ -37,9 +38,9 @@ impl<'a> InteractiveShell<'a> {
}
});
shell.set_previous_status(previous_status); // Set the previous exit code again
out
Prompt::from(out)
} else {
" ".repeat(blocks)
Prompt::from(" ".repeat(blocks))
}
}
}
......@@ -2,7 +2,7 @@ use super::{EmptyCompleter, Status};
use crate as ion_shell;
use builtins_proc::builtin;
use calc::{eval_polish_with_env, eval_with_env, CalcError, Value};
use liner::Context;
use liner::{Context, Prompt};
use std::io::{self, Read};
const REPL_GUIDE: &str = r#"Ion's integrated calculator
......@@ -89,7 +89,7 @@ pub fn math(args: &[crate::types::Str], _: &mut crate::Shell<'_>) -> Status {
let mut ans = None;
loop {
match context
.read_line("ion-math: ", None, &mut EmptyCompleter)
.read_line(Prompt::from("ion-math: "), None, &mut EmptyCompleter)
.as_ref()
.map(AsRef::as_ref)
{
......
......@@ -40,7 +40,7 @@ use crate::{
};
use builtins_proc::builtin;
use itertools::Itertools;
use liner::{Completer, Context};
use liner::{Completer, Context, Prompt};
use std::{
borrow::Cow,
collections::HashMap,
......@@ -575,7 +575,8 @@ pub fn read(args: &[types::Str], shell: &mut Shell<'_>) -> Status {
if atty::is(atty::Stream::Stdin) {
let mut con = Context::new();
for arg in args.iter().skip(1) {
match con.read_line(format!("{}=", arg.trim()), None, &mut EmptyCompleter) {
match con.read_line(Prompt::from(format!("{}=", arg.trim())), None, &mut EmptyCompleter)
{
Ok(buffer) => {
shell.variables_mut().set(arg.as_ref(), buffer.trim());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment