Add command specific completions for file and locate, written by Velko Hristov

darcs-hash:20070128114415-ac50b-f5844d6523a9aed3ca0e881c6c125072caee4978.gz
This commit is contained in:
axel 2007-01-28 21:44:15 +10:00
parent 6a60377e02
commit bbd229b206
2 changed files with 43 additions and 18 deletions

View file

@ -0,0 +1,21 @@
#completion for file
complete -c file -s b -l brief --description 'Do not prepend filenames to output lines'
complete -c file -s c -l checking-printout --description 'Print the parsed form of the magic file'
complete -c file -s C -l compile --description 'Write an output file containing a pre-parsed version of file'
complete -c file -s h -l no-dereference --description 'Do not follow symlinks'
complete -c file -s i -l mime --description 'Output mime type strings instead human readable strings'
complete -c file -s k -l keep-going --description 'Don\'t stop at the first match'
complete -c file -s L -l dereference --description 'Follow symlinks'
complete -c file -s n -l no-buffer --description 'Flush stdout after checking each file'
complete -c file -s N -l no-pad --description 'Don\'t pad filenames so that they align in the output'
complete -c file -s p -l preserve-date --description 'Attempt to preserve the access time of files analyzed'
complete -c file -s r -l raw --description 'Don\'t translate unprintable characters to octal'
complete -c file -s s -l special-files --description 'Read block and character device files too'
complete -c file -s v -l version --description 'Print the version of the program and exit'
complete -c file -s z -l uncompress --description 'Try to look inside compressed files'
complete -c file -l help --description 'Print a help message and exit'
complete -r -c file -s f -l files-from --description 'Read the names of the files to be examined from a file'
complete -r -c file -s F -l separator --description 'Use other string as result field separator instead of :'
complete -r -c file -s m -l magic-file --description 'Alternate list of files containing magic numbers'

View file

@ -1,19 +1,23 @@
#completion for locate
complete -c locate -s b -l basename --description "Match only the base name against the specified patterns" complete -c locate -s A -l all --description 'Print only names which match all non-option arguments'
complete -c locate -s c -l count --description "Instead of writing file names on standard output, write the number of matching entries only" complete -c locate -s c -l count --description 'Print the total number of matches found'
complete -c locate -s d -l database --description "Replace the default database with specified path" -r complete -c locate -s e -l existing --description 'Only print out such names that currently exist'
complete -c locate -s e -l existing --description "Print only entries that refer to files existing at the time locate is run" complete -c locate -s E -l non-existing --description 'Only print out such names that currently do not exist'
complete -c locate -s L -l follow --description "Follow symlinks when checking for existing files" complete -c locate -s L -l follow --description 'Consider broken symbolic links to be non-existing files'
complete -c locate -s h -l help --description "Display help and exit" complete -c locate -s P -l nofollow --description 'Treat broken symbolic links as if they were existing'
complete -c locate -s i -l ignore-case --description "Ignore case distinctions when matching patterns" complete -c locate -s H -l nofollow --description 'Treat broken symbolic links as if they were existing'
complete -c locate -s l -s n -l limit --description "Exit successfully after finding specified number of entires" -r complete -c locate -s i -l ignore-case --description 'Ignore case distinctions between pattern and file names'
complete -c locate -s m -l mmap --description "Ignored" complete -c locate -s m -l mmap --description 'Does nothing. For compatibility with BSD locate'
complete -c locate -s P -s H -l nofollow --description "Do not follow symlinks when checking for existing files" complete -c locate -s 0 -l null --description 'Use ASCII NUL as a separator, instead of newline'
complete -c locate -s 0 -l null --description "Separate the entries on output using the ASCII NUL character instead of writing each entry on a separate line" complete -c locate -s p -l print --description 'Print search results when they normally would not'
complete -c locate -s S -l statistics --description "Write statistics about each read database to standard output" complete -c locate -s w -l whole-name --description 'Match against the whole name of the file'
complete -c locate -s q -l quiet --description "Write no messages about errors encountered" complete -c locate -s b -l base-name --description 'Match against the final component of the file name'
complete -c locate -s r -l regexp --description "Search for specified basic regex" -r complete -c locate -s r -l regex --description 'The pattern is regular expression instead of glob pattern'
complete -c locate -l regex --description "Interpret all patterns as extended regexps" complete -c locate -s s -l stdio --description 'Does nothing. For compatibility with BSD locate'
complete -c locate -s s -l stdio --description "Ignored" complete -c locate -s S -l statistics --description 'Print statistics about each locate database and exit'
complete -c locate -s V -l version --description "Display version and exit" complete -c locate -l help --description 'Print a summary of the options to locate and exit'
complete -c locate -s w -l wholename --description "Match only the whole path name against the specified patterns" complete -c locate -l version --description 'Print the version number of locate and exit'
complete -r -c locate -s d -l database --description 'Search the file name databases in these directories'
complete -r -c locate -s l -l limit --description 'Limit the number of matches'