From cd86979e24aa82b95eaee9389b9e00a9685ca27c Mon Sep 17 00:00:00 2001 From: booniepepper Date: Thu, 1 Feb 2024 20:11:35 -0800 Subject: [PATCH] add "use" for interactive, update interactive exit messaging, bump to 3.6.3 --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 4 ++-- sigi.1 | 10 +++++----- src/cli/interact.rs | 16 ++++++++-------- tests/interactive_tests.rs | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 26615a0..39db1f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -625,7 +625,7 @@ dependencies = [ [[package]] name = "sigi" -version = "3.6.2" +version = "3.6.3" dependencies = [ "chrono", "clap", diff --git a/Cargo.toml b/Cargo.toml index b3eaf8d..f81a733 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sigi" -version = "3.6.2" +version = "3.6.3" authors = ["J.R. Hill "] edition = "2021" license = "GPL-2.0-only" diff --git a/README.md b/README.md index a3481e5..a60b50d 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,8 @@ Use subcommands in interactive mode directly. No OPTIONS (flags) are understood The following additional commands are available: ? Show the short version of "help" clear Clear the terminal screen - stack Change to the specified stack - quit/q/exit Quit interactive mode + use Change to the specified stack [aliases: stack] + exit Quit interactive mode [aliases: quit, q] ``` # Examples diff --git a/sigi.1 b/sigi.1 index a6893ea..03f6105 100644 --- a/sigi.1 +++ b/sigi.1 @@ -1,4 +1,4 @@ -.TH sigi 1 "October 15, 2023" "version 3.6.2" "USER COMMANDS" +.TH sigi 1 "February 1, 2024" "version 3.6.3" "USER COMMANDS" .\" .SH NAME sigi \- An organizing tool for terminal lovers who hate organizing @@ -148,11 +148,11 @@ Show the short version of \"help\" clear Clear the terminal screen .TP -stack -Change to the specified stack +use +Change to the specified stack [aliases: stack] .TP -quit/q/exit -Quit interactive mode +exit +Quit interactive mode [aliases: quit, q] .RE .\" .\" ================================ diff --git a/src/cli/interact.rs b/src/cli/interact.rs index 34bee9c..f1e3f86 100644 --- a/src/cli/interact.rs +++ b/src/cli/interact.rs @@ -17,8 +17,8 @@ The ; character can be used to separate commands. The following additional commands are available: ? Show the short version of \"help\" clear Clear the terminal screen - stack Change to the specified stack - quit/q/exit Quit interactive mode"; + use Change to the specified stack [aliases: stack] + exit Quit interactive mode [aliases: quit, q]"; pub const INTERACT_LONG_INSTRUCTIONS: &str = "INTERACTIVE MODE: @@ -43,10 +43,10 @@ In interactive mode, the following additional commands are available: Show the short version of \"help\" clear Clear the terminal screen - stack - Change to the specified stack - quit/q/exit - Quit interactive mode"; + use + Change to the specified stack [aliases: stack] + exit + Quit interactive mode [aliases: quit, q]"; // TODO: pagination/scrollback? // TODO: more comprehensive tests @@ -120,7 +120,7 @@ fn print_welcome_msg(output: OutputFormat) { if output.is_nonquiet_for_humans() { println!("sigi {}", SIGI_VERSION); println!( - "Type \"quit\", \"q\", or \"exit\" to quit. (On Unixy systems, Ctrl+C or Ctrl+D also work)" + "Type \"exit\", \"quit\", or \"q\" to quit. (On Unixy systems, Ctrl+C or Ctrl+D also work)" ); println!("Type \"?\" for quick help, or \"help\" for a more verbose help message."); println!(); @@ -178,7 +178,7 @@ fn parse_line(line: String, stack: String) -> InteractAction { "help" => InteractAction::LongHelp, "clear" => InteractAction::Clear, "exit" | "quit" | "q" => InteractAction::Exit(term), - "stack" => match tokens.get(1) { + "use" | "stack" => match tokens.get(1) { Some(stack) => InteractAction::UseStack(stack.to_string()), None => InteractAction::MissingArgument("stack name".to_string()), }, diff --git a/tests/interactive_tests.rs b/tests/interactive_tests.rs index 2b16d44..1be192b 100644 --- a/tests/interactive_tests.rs +++ b/tests/interactive_tests.rs @@ -7,7 +7,7 @@ fn sigi_interactive_preamble() { let res = sigi("_integ::interactive", &["interactive"]); res.assert_success(); res.assert_stdout_line_starts_with("sigi 3.6"); - res.assert_stdout_line_starts_with(r#"Type "quit", "q", or "exit" to quit"#); + res.assert_stdout_line_starts_with(r#"Type "exit", "quit", or "q" to quit"#); res.assert_stdout_line_starts_with( r#"Type "?" for quick help, or "help" for a more verbose help message"#, ); @@ -18,7 +18,7 @@ fn sigi_interactive_preamble() { fn sigi_interactive_basic() { let res = piping(&["push hello world"]).into_sigi("_integ::interactive", &["interactive"]); res.assert_stdout_line_starts_with("sigi 3.6"); - res.assert_stdout_line_starts_with(r#"Type "quit", "q", or "exit" to quit"#); + res.assert_stdout_line_starts_with(r#"Type "exit", "quit", or "q" to quit"#); res.assert_stdout_line_starts_with( r#"Type "?" for quick help, or "help" for a more verbose help message"#, ); @@ -35,7 +35,7 @@ fn sigi_interactive_basic_semicolons() { res.assert_stderr_empty(); res.assert_stdout_lines_eq(&[ "*", - r#"Type "quit", "q", or "exit" to quit. (On Unixy systems, Ctrl+C or Ctrl+D also work)"#, + r#"Type "exit", "quit", or "q" to quit. (On Unixy systems, Ctrl+C or Ctrl+D also work)"#, r#"Type "?" for quick help, or "help" for a more verbose help message."#, "", "Created: goodbye",