Skip to content

Commit 5c691a8

Browse files
authored
Handle recipes in submodules in fish completion script (#2514)
1 parent 462d381 commit 5c691a8

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

src/completions.rs

+1-27
Original file line numberDiff line numberDiff line change
@@ -97,33 +97,7 @@ const FISH_RECIPE_COMPLETIONS: &str = r#"function __fish_just_complete_recipes
9797
if string match -rq '(-f|--justfile)\s*=?(?<justfile>[^\s]+)' -- (string split -- ' -- ' (commandline -pc))[1]
9898
set -fx JUST_JUSTFILE "$justfile"
9999
end
100-
just --list 2> /dev/null | tail -n +2 | awk '{
101-
command = $1;
102-
args = $0;
103-
desc = "";
104-
delim = "";
105-
sub(/^[[:space:]]*[^[:space:]]*/, "", args);
106-
gsub(/^[[:space:]]+|[[:space:]]+$/, "", args);
107-
108-
if (match(args, /#.*/)) {
109-
desc = substr(args, RSTART+2, RLENGTH);
110-
args = substr(args, 0, RSTART-1);
111-
gsub(/^[[:space:]]+|[[:space:]]+$/, "", args);
112-
}
113-
114-
gsub(/\+|=[`\'"][^`\'"]*[`\'"]/, "", args);
115-
gsub(/ /, ",", args);
116-
117-
if (args != ""){
118-
args = "Args: " args;
119-
}
120-
121-
if (args != "" && desc != "") {
122-
delim = "; ";
123-
}
124-
125-
print command "\t" args delim desc
126-
}'
100+
printf "%s\n" (string split " " (just --summary))
127101
end
128102
129103
# don't suggest files right off

0 commit comments

Comments
 (0)