Standardize complex commands:

- attributes
- reg
- schtasks
This commit is contained in:
EmilySeville7cfg 2022-01-24 20:43:28 +10:00 committed by ridiculousfish
parent 78bd0f9cdb
commit cdae6536fd
3 changed files with 58 additions and 32 deletions

View file

@ -27,12 +27,6 @@ shadowcopy\tSpecify that the volume is a shadow copy volume'
end
function __attributes_complete_args -d 'Function to generate args'
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'
return
end
if __fish_seen_subcommand_from disk
__attributes_disk_complete_args
else if __fish_seen_subcommand_from volume
@ -41,3 +35,8 @@ volume\tDisplay, set, or clear the attributes of a volume'
end
complete -c attributes -f -a '(__attributes_complete_args)'
complete -c attributes -f -n 'not __fish_seen_subcommand_from disk volume' -a disk \
-d 'Display, set, or clear the attributes of a disk'
complete -c attributes -f -n 'not __fish_seen_subcommand_from dick volume' -a volume \
-d 'Display, set, or clear the attributes of a volume'

View file

@ -99,21 +99,6 @@ function __reg_save_complete_args
end
function __reg_complete_args -d 'Function to generate args'
if not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload
echo -e 'add\tAdd a new subkey or entry
compare\tCompare specified registry subkeys or entries
copy\tCopy a registry entry
delete\tDelete a subkey or entries
export\tCopy the specified subkeys, entries, and values of the local computer into a file
import\tCopy the contents of a file that contains registry data into the registry of the local computer
load\tWrite saved subkeys and entries into a different subkey in the registry
query\tReturn a list of the next tier of subkeys and entries
restore\tWrite saved subkeys and entries back
save\tSave a copy of specified subkeys, entries, and values of the registry in a specified file
unload\tRemove a section of the registry that was loaded using the reg load operation'
return
end
set -l previous_token (commandline -oc)[-1]
if __fish_seen_subcommand_from add
@ -134,3 +119,37 @@ unload\tRemove a section of the registry that was loaded using the reg load oper
end
complete -c reg -f -a '(__reg_complete_args)'
complete -c reg -f \
-n 'not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload' -a add \
-d 'Add a new subkey or entry'
complete -c reg -f \
-n 'not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload' -a compare \
-d 'Compare specified registry subkeys or entries'
complete -c reg -f \
-n 'not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload' -a copy \
-d 'Copy a registry entry'
complete -c reg -f \
-n 'not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload' -a delete \
-d 'Delete a subkey or entries'
complete -c reg -f \
-n 'not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload' -a export \
-d 'Copy the specified subkeys, entries, and values of the local computer into a file'
complete -c reg -f \
-n 'not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload' -a import \
-d 'Copy the contents of a file that contains registry data into the registry of the local computer'
complete -c reg -f \
-n 'not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload' -a load \
-d 'Write saved subkeys and entries into a different subkey in the registry'
complete -c reg -f \
-n 'not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload' -a query \
-d 'Return a list of the next tier of subkeys and entries'
complete -c reg -f \
-n 'not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload' -a restore \
-d 'Write saved subkeys and entries back'
complete -c reg -f \
-n 'not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload' -a save \
-d 'Save a copy of specified subkeys, entries, and values of the registry in a specified file'
complete -c reg -f \
-n 'not __fish_seen_subcommand_from add compare copy delete export import load query restore save unload' -a unload \
-d 'Remove a section of the registry that was loaded using the reg load operation'

View file

@ -214,17 +214,6 @@ function __schtasks_run_complete_args -a previous_token
end
function __schtasks_complete_args -d 'Function to generate args'
if not __fish_seen_argument -w change -w create -w delete -w end \
-w query -w run
echo -e '/change\tChange one or more properties of a task
/create\tSchedule a new task
/delete\tDelete a scheduled task
/end\tStop a program started by a task
/query\tDisplay tasks scheduled to run on the computer
/run\tStart a scheduled task immediately'
return
end
set --local previous_token (commandline -oc)[-1]
if __fish_seen_argument -w change
@ -243,3 +232,22 @@ function __schtasks_complete_args -d 'Function to generate args'
end
complete -c schtasks -f -a '(__schtasks_complete_args)'
complete -c schtasks -f -n 'not __fish_seen_argument -w change -w create -w delete -w end \
-w query -w run' -a /change \
-d 'Change one or more properties of a task'
complete -c schtasks -f -n 'not __fish_seen_argument -w change -w create -w delete -w end \
-w query -w run' -a /create \
-d 'Schedule a new task'
complete -c schtasks -f -n 'not __fish_seen_argument -w change -w create -w delete -w end \
-w query -w run' -a /delete \
-d 'Delete a scheduled task'
complete -c schtasks -f -n 'not __fish_seen_argument -w change -w create -w delete -w end \
-w query -w run' -a /end \
-d 'Stop a program started by a task'
complete -c schtasks -f -n 'not __fish_seen_argument -w change -w create -w delete -w end \
-w query -w run' -a /query \
-d 'Display tasks scheduled to run on the computer'
complete -c schtasks -f -n 'not __fish_seen_argument -w change -w create -w delete -w end \
-w query -w run' -a /run \
-d 'Start a scheduled task immediately'