Skip to content

Commit

Permalink
fix: completions not split
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarendorff2 authored and domsleee committed Sep 3, 2024
1 parent 1ab530c commit 3df881f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn maybe_process_path(arg: &str) -> String {
return format!("'{replaced_single_quotes}'",);
}

arg.to_string()
arg.split(' ').last().unwrap().to_string()
}

fn get_string_from_files(root_args: &RootArgs) -> String {
Expand Down
7 changes: 7 additions & 0 deletions tests/test_complete_git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ use crate::speculoos::prelude::ContainingIntoIterAssertions;
mod testenv;
pub use testenv::*;

#[apply(shell_to_use)]
fn test_primary_command_is_not_included(shell: &str) {
let lines = util::run_command(shell, "Invoke-TabComplete 'git check'");
assert_that!(lines).does_not_contain("git checkout".to_string());
assert_that!(lines).contains("checkout".to_string());
}

#[apply(shell_to_use)]
fn test_checkout_branches(shell: &str) {
let lines = util::run_command(shell, "Invoke-TabComplete 'git checkout '");
Expand Down

0 comments on commit 3df881f

Please sign in to comment.