From fac6c668d28093b07d7305eb54de803bbda7b5a8 Mon Sep 17 00:00:00 2001 From: Alexandr Date: Wed, 25 Oct 2023 16:08:30 +0300 Subject: [PATCH] fish_completions: make regex macos and linux friendly --- completions/just.fish | 2 +- src/completions.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/just.fish b/completions/just.fish index 0771de0135..086f513913 100644 --- a/completions/just.fish +++ b/completions/just.fish @@ -1,5 +1,5 @@ function __fish_just_complete_recipes - just --list 2> /dev/null | sed -e '1d; s/^\s*\([^[:space:]]*\)[^#]*$/\1/' -e 's/^\s*\([^[:space:]]*\)[^#]*# \(.*\)$/\1\t\2/' + just --list 2> /dev/null | sed -E -e '1d; s/^[[:space:]]*([^[:space:]]+)[[:space:]]*#[[:space:]]*(.*)$/\1\t\2/' -e 's/^[[:space:]]*([^[:space:]]+)[[:space:]]*$/\1/' end # don't suggest files right off diff --git a/src/completions.rs b/src/completions.rs index 3d805ff045..77cf19cd38 100644 --- a/src/completions.rs +++ b/src/completions.rs @@ -1,5 +1,5 @@ pub(crate) const FISH_RECIPE_COMPLETIONS: &str = r#"function __fish_just_complete_recipes - just --list 2> /dev/null | sed -e '1d; s/^\s*\([^[:space:]]*\)[^#]*$/\1/' -e 's/^\s*\([^[:space:]]*\)[^#]*# \(.*\)$/\1\t\2/' + just --list 2> /dev/null | sed -E -e '1d; s/^[[:space:]]*([^[:space:]]+)[[:space:]]*#[[:space:]]*(.*)$/\1\t\2/' -e 's/^[[:space:]]*([^[:space:]]+)[[:space:]]*$/\1/' end # don't suggest files right off