fish_update_completions: pass explicit directory argument

Gets rid of another use of XDG_CACHE_HOME; this gets us closer to
a single source of truth. Not super important right now, but will
be helpful if we allow users to override XDG_CACHE_HOME in future.
I guess we could also remove it from create_manpage_completions.py,
that's unnecessary breakage but probably fine since this is not
public-facing.
This commit is contained in:
Johannes Altmanninger
2026-06-05 21:01:05 +08:00
parent ac27876252
commit 974aa160f3
3 changed files with 4 additions and 3 deletions

View File

@@ -16,9 +16,9 @@ function fish_update_completions --description "Update man-page based completion
- \
# Use the manpath
--manpath \
--directory=$__fish_cache_dir/generated_completions \
# Clean up old completions
--cleanup-in $__fish_user_data_dir/generated_completions \
--cleanup-in $__fish_cache_dir/generated_completions
--cleanup-in $__fish_user_data_dir/generated_completions
status get-file tools/create_manpage_completions.py |
if $detach

View File

@@ -2231,6 +2231,7 @@ if __name__ == "__main__":
args.directory = os.path.expanduser(
xdg_cache_home + "/fish/generated_completions/"
)
if not args.stdout:
try:
os.makedirs(args.directory)
except OSError as e:

View File

@@ -24,7 +24,7 @@ end each output line with NUL, not newline
'
MANPATH=$PWD/man fish_update_completions
# CHECK: Parsing man pages and writing completions to {{.*}}/generated_completions/
# CHECK: Parsing man pages and writing completions to {{.*}}/generated_completions
# CHECK: {{.*}} 1 / 1 : dirname.1{{.*}}
cd $__fish_cache_dir