mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 02:27:28 +08:00
Clean-up attributes completion:
- distribute code to several functions
This commit is contained in:
parent
a2ae67f629
commit
1ee3f1fc8c
|
@ -1,3 +1,28 @@
|
|||
function __attributes_disk_generate_args
|
||||
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'
|
||||
return
|
||||
end
|
||||
|
||||
echo -e 'readonly\tSpecify that the disk is read-only
|
||||
noerr\tWhen an error is encountered, DiskPart continues to process commands'
|
||||
end
|
||||
|
||||
function __attributes_volume_generate_args
|
||||
if not __fish_seen_subcommand_from set clear
|
||||
echo -e 'set\tSet the specified attribute of the volume with focus
|
||||
clear\tClear the specified attribute of the volume with focus'
|
||||
return
|
||||
end
|
||||
|
||||
echo -e 'readonly\tSpecify that the volume is read-only
|
||||
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'
|
||||
end
|
||||
|
||||
function __attributes_generate_args --description 'Function to generate args'
|
||||
if not __fish_seen_subcommand_from disk volume
|
||||
echo -e 'disk\tDisplay, set, or clear the attributes of a disk
|
||||
|
@ -6,30 +31,9 @@ volume\tDisplay, set, or clear the attributes of a volume'
|
|||
end
|
||||
|
||||
if __fish_seen_subcommand_from disk
|
||||
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'
|
||||
return
|
||||
end
|
||||
|
||||
echo -e 'readonly\tSpecify that the disk is read-only
|
||||
noerr\tWhen an error is encountered, DiskPart continues to process commands'
|
||||
return
|
||||
end
|
||||
|
||||
if __fish_seen_subcommand_from volume
|
||||
if not __fish_seen_subcommand_from set clear
|
||||
echo -e 'set\tSet the specified attribute of the volume with focus
|
||||
clear\tClear the specified attribute of the volume with focus'
|
||||
return
|
||||
end
|
||||
|
||||
echo -e 'readonly\tSpecify that the volume is read-only
|
||||
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'
|
||||
return
|
||||
__attributes_disk_generate_args
|
||||
else if __fish_seen_subcommand_from volume
|
||||
__attributes_volume_generate_args
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user