From e575a6323260b78c117530a072bc5feccb6cd0cd Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sun, 30 Jan 2022 19:48:20 -0800 Subject: [PATCH] chmod completions for non-GNU chmod And chgrp fixup. --- share/completions/chgrp.fish | 4 ++-- share/completions/chmod.fish | 29 +++++++++++++++++++---------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/share/completions/chgrp.fish b/share/completions/chgrp.fish index b2622c442..20b3f7761 100644 --- a/share/completions/chgrp.fish +++ b/share/completions/chgrp.fish @@ -19,6 +19,6 @@ else # not Linux complete -c chgrp -s n -d "id is numeric; avoid lookup" complete -c chgrp -s R -d "Operate recursively" complete -c chgrp -s v -d "Output filenames" - complete -c chgrp -s x -d "Don'1t traverse fs mount points" + complete -c chgrp -s x -d "Don't traverse fs mountpoints" complete -c chgrp -d Group -a "(__fish_complete_groups)" -end \ No newline at end of file +end diff --git a/share/completions/chmod.fish b/share/completions/chmod.fish index 3ad274bc3..ed8fcb0fb 100644 --- a/share/completions/chmod.fish +++ b/share/completions/chmod.fish @@ -4,13 +4,22 @@ # man page by the make_completions.py script, but may # have been hand edited since. # - -complete -c chmod -s c -l changes -d 'Like verbose but report only when a change is made' -complete -c chmod -l no-preserve-root -d 'Do not treat / specially (the default)' -complete -c chmod -l preserve-root -d 'Fail to operate recursively on /' -complete -c chmod -s f -l silent -l quiet -d 'Suppress most error messages' -complete -c chmod -s v -l verbose -d 'Output a diagnostic for every file processed' -complete -c chmod -l reference -d 'Use RFILEs mode instead of MODE values' -r -complete -c chmod -s R -l recursive -d 'Change files and directories recursively' -complete -c chmod -l help -d 'Display help and exit' -complete -c chmod -l version -d 'Display version and exit' +if chmod --version 2>/dev/null # gnu's not unix + complete chmod -s c -l changes -d 'Like -v but report only changes' + complete chmod -l no-preserve-root -d 'Don\'t treat / special (default)' + complete chmod -l preserve-root -d 'Fail to operate recursively on /' + complete chmod -s f -l silent -l quiet -d 'Suppress most errors' + complete chmod -s v -l verbose -d 'Prints each file processed' + complete chmod -l reference -d 'Use RFILEs mode instead of MODE values' -r + complete chmod -s R -l recursive -d 'Operate recursively' + complete chmod -l help -d 'Display help and exit' + complete chmod -l version -d 'Display version and exit' +else # guess it might be unix + complete chmod -s f -d 'Suppress errors' + complete chmod -s H -d "Follow given symlinks with -R" + complete chmod -s h -d "Don't dereference given symlinks" + complete chmod -s L -d "Follow all symlinks with -R" + complete chmod -s P -d "Follow no symlinks with -R" + complete chmod -s R -d 'Operate recursively' + complete chmod -s v -d 'Prints each file processed' +end