mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-22 18:51:22 +02:00
Don't print welcome message when a value is piped
This commit is contained in:
parent
2573ae16e2
commit
2402d444f5
21
Cargo.lock
generated
21
Cargo.lock
generated
@ -18,6 +18,17 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "atty"
|
||||||
|
version = "0.2.14"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi",
|
||||||
|
"libc",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "az"
|
name = "az"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
@ -116,6 +127,15 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hermit-abi"
|
||||||
|
version = "0.1.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
version = "0.3.46"
|
version = "0.3.46"
|
||||||
@ -142,6 +162,7 @@ name = "kalk_cli"
|
|||||||
version = "0.5.3"
|
version = "0.5.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term",
|
"ansi_term",
|
||||||
|
"atty",
|
||||||
"kalk",
|
"kalk",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"regex",
|
"regex",
|
||||||
|
@ -22,6 +22,7 @@ lazy_static = "1.4.0"
|
|||||||
regex = "1"
|
regex = "1"
|
||||||
rustyline = "7.1.0"
|
rustyline = "7.1.0"
|
||||||
seahorse = "1.1.1"
|
seahorse = "1.1.1"
|
||||||
|
atty = "0.2.14"
|
||||||
|
|
||||||
[target.'cfg(windows)'.build-dependencies]
|
[target.'cfg(windows)'.build-dependencies]
|
||||||
winres = "0.1"
|
winres = "0.1"
|
||||||
|
@ -24,11 +24,15 @@ pub fn start(mut parser: &mut parser::Context, precision: u32) {
|
|||||||
highlighter: LineHighlighter {},
|
highlighter: LineHighlighter {},
|
||||||
validator: MatchingBracketValidator::new(),
|
validator: MatchingBracketValidator::new(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// If in tty, print the welcome message
|
||||||
|
if atty::is(atty::Stream::Stdin) && atty::is(atty::Stream::Stdout) {
|
||||||
println!("kalk");
|
println!("kalk");
|
||||||
println!(
|
println!(
|
||||||
"{}",
|
"{}",
|
||||||
ansi_term::Color::Fixed(246).paint("Type 'help' for instructions.")
|
ansi_term::Color::Fixed(246).paint("Type 'help' for instructions.")
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let prompt = if cfg!(windows) {
|
let prompt = if cfg!(windows) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user