From 6e107e057909e1c4218bc04ea3831086ddb542c0 Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Tue, 10 Dec 2024 18:52:51 +0100 Subject: [PATCH] Enable fish to complete recipes in modules --- src/completions.rs | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/completions.rs b/src/completions.rs index 093011906b..7d137acf9e 100644 --- a/src/completions.rs +++ b/src/completions.rs @@ -97,33 +97,7 @@ const FISH_RECIPE_COMPLETIONS: &str = r#"function __fish_just_complete_recipes if string match -rq '(-f|--justfile)\s*=?(?[^\s]+)' -- (string split -- ' -- ' (commandline -pc))[1] set -fx JUST_JUSTFILE "$justfile" end - just --list 2> /dev/null | tail -n +2 | awk '{ - command = $1; - args = $0; - desc = ""; - delim = ""; - sub(/^[[:space:]]*[^[:space:]]*/, "", args); - gsub(/^[[:space:]]+|[[:space:]]+$/, "", args); - - if (match(args, /#.*/)) { - desc = substr(args, RSTART+2, RLENGTH); - args = substr(args, 0, RSTART-1); - gsub(/^[[:space:]]+|[[:space:]]+$/, "", args); - } - - gsub(/\+|=[`\'"][^`\'"]*[`\'"]/, "", args); - gsub(/ /, ",", args); - - if (args != ""){ - args = "Args: " args; - } - - if (args != "" && desc != "") { - delim = "; "; - } - - print command "\t" args delim desc - }' + printf "%s\n" (string split " " (just --summary)) end # don't suggest files right off