Skip to content

Commit

Permalink
add "use" for interactive, update interactive exit messaging, bump to…
Browse files Browse the repository at this point in the history
… 3.6.3
  • Loading branch information
booniepepper committed Feb 2, 2024
1 parent be55281 commit cd86979
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sigi"
version = "3.6.2"
version = "3.6.3"
authors = ["J.R. Hill <[email protected]>"]
edition = "2021"
license = "GPL-2.0-only"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions sigi.1
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
.\"
.\" ================================
Expand Down
16 changes: 8 additions & 8 deletions src/cli/interact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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!();
Expand Down Expand Up @@ -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()),
},
Expand Down
6 changes: 3 additions & 3 deletions tests/interactive_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"#,
);
Expand All @@ -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"#,
);
Expand All @@ -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",
Expand Down

0 comments on commit cd86979

Please sign in to comment.