From fbbf498afbb423304ae065544339bacc9bf60f6d Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Fri, 26 Nov 2021 18:36:14 +1000 Subject: [PATCH] Enhance setx completion: - more accurate hints --- share/completions/setx.fish | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/share/completions/setx.fish b/share/completions/setx.fish index c7200de8a..fb5fd20c4 100644 --- a/share/completions/setx.fish +++ b/share/completions/setx.fish @@ -2,26 +2,27 @@ function __setx_generate_args --description 'Function to generate args' set --local previous_token (commandline --tokenize --cut-at-cursor)[-1] if test "$previous_token" = '/u' - wmic UserAccount get Name | sed --quiet '1b;/./p' + __fish_list_windows_users return end - if test "$previous_token" = '/p' - __fish_generate_password - return + if not __fish_seen_argument --windows 'a' --windows 'r' --windows 'x' + echo -e '/a\tSpecify absolute coordinates and offset as search parameters +/r\tSpecify relative coordinates and offset from String as search parameters +/x\tDisplay file coordinates, ignoring the /a, /r, and /d command-line options' + end + + if __fish_seen_argument --windows 'a' --windows 'r' + echo -e '/m\tSpecify to set the variable in the system environment' end - echo -e '/u\tSpecify the name or IP address of a remote computer + echo -e '/s\tSpecify the name or IP address of a remote computer +/u\tRun the script with the credentials of the specified user account /p\tSpecify the password of the user account that is specified in the /u parameter +/k\tSpecify that the variable is set based on information from a registry key /f\tSpecify the file that you want to use /d\tSpecify delimiters to be used in addition to the four built-in delimiters /?\tShow help' - - if not __fish_seen_argument --windows 'a' --windows 'm' --windows 'x' - echo -e '/a\tSpecify absolute coordinates and offset as search parameters -/m\tSpecify to set the variable in the system environment -/x\tDisplay file coordinates, ignoring the /a, /r, and /d command-line options' - end end complete --command setx --no-files --arguments '(__setx_generate_args)' \ No newline at end of file