2021-11-25 03:35:34 +00:00
|
|
|
function __attrib_generate_args --description 'Function to generate args'
|
|
|
|
set --local current_token (commandline --current-token --cut-at-cursor)
|
|
|
|
switch $current_token
|
|
|
|
case '+*'
|
|
|
|
echo -e 'r\tSet the Read-only file attribute
|
|
|
|
a\tSet the Archive file attribute
|
|
|
|
s\tSet the System file attribute
|
|
|
|
h\tSet the Hidden file attribute
|
|
|
|
i\tSet the Not Content Indexed file attribute' | awk -F '\t' "{ printf \"$current_token%s\t%s\n\", \$1, \$2 }"
|
|
|
|
case '-*'
|
2021-11-25 08:12:14 +00:00
|
|
|
echo -e 'r\tClear the Read-only file attribute
|
|
|
|
a\tClear the Archive file attribute
|
|
|
|
s\tClear the System file attribute
|
|
|
|
h\tClear the Hidden file attribute
|
|
|
|
i\tClear the Not Content Indexed file attribute' | awk -F '\t' "{ printf \"$current_token%s\t%s\n\", \$1, \$2 }"
|
2021-11-26 00:12:56 +00:00
|
|
|
case '/*'
|
2021-11-25 12:44:50 +00:00
|
|
|
echo -e '+\tSet the file attribute
|
|
|
|
-\tClear the file attribute
|
|
|
|
/s\tApply to matching files in the current directory and all of its subdirectories
|
2021-11-25 08:12:14 +00:00
|
|
|
/d\tApply attrib and any command-line options to directories
|
|
|
|
/l\tApply attrib and any command-line options to the Symbolic Link, rather than the target of it
|
2021-11-25 03:35:34 +00:00
|
|
|
/?\tShow help'
|
2021-11-26 00:12:56 +00:00
|
|
|
case '*'
|
|
|
|
wmic logicaldisk get caption | sed --quiet '1b;/./p'
|
2021-11-25 03:35:34 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
complete --command attrib --no-files --arguments '(__attrib_generate_args)'
|