From cd991d5936a086f3ace427d7066197aaaae4490d Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Fri, 26 Nov 2021 10:20:09 +1000 Subject: [PATCH] /d support for cleanmgr command --- share/completions/cleanmgr.fish | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/share/completions/cleanmgr.fish b/share/completions/cleanmgr.fish index d09d3c915..a5318a986 100644 --- a/share/completions/cleanmgr.fish +++ b/share/completions/cleanmgr.fish @@ -1,7 +1,18 @@ -complete --command cleanmgr --no-files --arguments '/d\t"Specify the drive that you want Disk Cleanup to clean" -/sageset\t"Display the Disk Cleanup Settings dialog box and also create a registry keyt" -/sagerun\t"Run the specified tasks that are assigned to the n value if you use the /sageset option" -/tuneup\t"Run /sageset and /sagerun for the same n" -/lowdisk\t"Run with the default settings" -/verylowdisk\t"Run with the default settings, no user prompts" -/?\t"Show help"' \ No newline at end of file +function __cleanmgr_generate_args --description 'Function to generate args' + set --local previous_token (commandline --tokenize --cut-at-cursor)[-1] + + if test "$previous_token" = '/d' + wmic logicaldisk get caption | sed --quiet '1b;/./p' + return + end + + echo -e '/d\tSpecify the drive that you want Disk Cleanup to clean +/sageset\tDisplay the Disk Cleanup Settings dialog box and also create a registry keyt +/sagerun\tRun the specified tasks that are assigned to the n value if you use the /sageset option +/tuneup\tRun /sageset and /sagerun for the same n +/lowdisk\tRun with the default settings +/verylowdisk\tRun with the default settings, no user prompts +/?\tShow help' +end + +complete --command cleanmgr --no-files --arguments '(__cleanmgr_generate_args)' \ No newline at end of file