2022-01-24 13:51:09 +08:00
|
|
|
function __attributes_disk_complete_args
|
2021-11-26 16:46:02 +08:00
|
|
|
if not __fish_seen_subcommand_from set clear
|
|
|
|
echo -e 'set\tSet the specified attribute of the disk with focus
|
|
|
|
clear\tClear the specified attribute of the disk with focus'
|
2021-11-25 12:00:45 +08:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2021-11-26 16:46:02 +08:00
|
|
|
echo -e 'readonly\tSpecify that the disk is read-only
|
2021-11-25 16:12:14 +08:00
|
|
|
noerr\tWhen an error is encountered, DiskPart continues to process commands'
|
2021-11-26 16:46:02 +08:00
|
|
|
end
|
2021-11-25 12:00:45 +08:00
|
|
|
|
2022-01-24 13:51:09 +08:00
|
|
|
function __attributes_volume_complete_args
|
2021-11-26 16:46:02 +08:00
|
|
|
if not __fish_seen_subcommand_from set clear
|
|
|
|
echo -e 'set\tSet the specified attribute of the volume with focus
|
2021-11-25 16:12:14 +08:00
|
|
|
clear\tClear the specified attribute of the volume with focus'
|
2021-11-26 16:46:02 +08:00
|
|
|
return
|
|
|
|
end
|
2021-11-25 12:00:45 +08:00
|
|
|
|
2021-11-26 16:46:02 +08:00
|
|
|
echo -e 'readonly\tSpecify that the volume is read-only
|
2021-11-25 16:12:14 +08:00
|
|
|
readonly\tSpecify that the volume is hidden
|
|
|
|
nodefaultdriveletter\tSpecify that the volume does not receive a drive letter by default
|
|
|
|
shadowcopy\tSpecify that the volume is a shadow copy volume
|
|
|
|
noerr\tWhen an error is encountered, DiskPart continues to process commands'
|
2021-11-26 16:46:02 +08:00
|
|
|
end
|
|
|
|
|
2022-01-24 13:51:09 +08:00
|
|
|
function __attributes_complete_args --description 'Function to generate args'
|
2021-11-26 16:46:02 +08:00
|
|
|
if not __fish_seen_subcommand_from disk volume
|
|
|
|
echo -e 'disk\tDisplay, set, or clear the attributes of a disk
|
|
|
|
volume\tDisplay, set, or clear the attributes of a volume'
|
2021-11-25 12:00:45 +08:00
|
|
|
return
|
|
|
|
end
|
2021-11-26 16:46:02 +08:00
|
|
|
|
|
|
|
if __fish_seen_subcommand_from disk
|
2022-01-24 13:51:09 +08:00
|
|
|
__attributes_disk_complete_args
|
2021-11-26 16:46:02 +08:00
|
|
|
else if __fish_seen_subcommand_from volume
|
2022-01-24 13:51:09 +08:00
|
|
|
__attributes_volume_complete_args
|
2021-11-26 16:46:02 +08:00
|
|
|
end
|
2021-11-25 12:00:45 +08:00
|
|
|
end
|
|
|
|
|
2022-01-24 13:51:09 +08:00
|
|
|
complete --command attributes --no-files --arguments '(__attributes_complete_args)'
|