Remove the rather stupid -y option for complete, which loads another commands completions. Mostly the same results can be had with fewer bugs and corner cases vy using the new dynamically loaded functions.

darcs-hash:20060215022228-ac50b-85614ed684f73460d43543a579ff2c7e7914efeb.gz
This commit is contained in:
axel 2006-02-15 12:22:28 +10:00
parent 8be3bf3e5d
commit c94b9e504d
31 changed files with 296 additions and 297 deletions

View File

@ -2000,7 +2000,7 @@ static int builtin_source( wchar_t ** argv )
{ {
wchar_t *fn = wrealpath( argv[1], 0 ); wchar_t *fn = wrealpath( argv[1], 0 );
const wchar_t *fn_intern; const wchar_t *fn_intern;
if( !fn ) if( !fn )
{ {
fn_intern = intern( argv[1] ); fn_intern = intern( argv[1] );
@ -2018,8 +2018,8 @@ static int builtin_source( wchar_t ** argv )
current_block->param1.source_dest = fn_intern; current_block->param1.source_dest = fn_intern;
parse_util_set_argv( argv+2); parse_util_set_argv( argv+2);
res = reader_read( fd ); res = reader_read( fd );
parser_pop_block(); parser_pop_block();
if( res ) if( res )
{ {

View File

@ -253,7 +253,7 @@ int builtin_complete( wchar_t **argv )
string_buffer_t short_opt; string_buffer_t short_opt;
array_list_t gnu_opt, old_opt; array_list_t gnu_opt, old_opt;
wchar_t *comp=L"", *desc=L"", *condition=L"", *load=0; wchar_t *comp=L"", *desc=L"", *condition=L"";
wchar_t *do_complete = 0; wchar_t *do_complete = 0;
@ -333,10 +333,6 @@ int builtin_complete( wchar_t **argv )
L"condition", required_argument, 0, 'n' L"condition", required_argument, 0, 'n'
} }
, ,
{
L"load", required_argument, 0, 'y'
}
,
{ {
L"do-complete", required_argument, 0, 'C' L"do-complete", required_argument, 0, 'C'
} }
@ -351,7 +347,7 @@ int builtin_complete( wchar_t **argv )
int opt = wgetopt_long( argc, int opt = wgetopt_long( argc,
argv, argv,
L"a:c:p:s:l:o:d:frxeun:y:C:", L"a:c:p:s:l:o:d:frxeun:C:",
long_options, long_options,
&opt_index ); &opt_index );
if( opt == -1 ) if( opt == -1 )
@ -368,6 +364,7 @@ int builtin_complete( wchar_t **argv )
long_options[opt_index].name ); long_options[opt_index].name );
sb_append( sb_err, sb_append( sb_err,
parser_current_line() ); parser_current_line() );
// builtin_print_help( argv[0], sb_err ); // builtin_print_help( argv[0], sb_err );
@ -428,15 +425,13 @@ int builtin_complete( wchar_t **argv )
condition = woptarg; condition = woptarg;
break; break;
case 'y':
load = woptarg;
break;
case 'C': case 'C':
do_complete = woptarg?woptarg:reader_get_buffer(); do_complete = woptarg?woptarg:reader_get_buffer();
break; break;
case '?': case '?':
sb_append( sb_err,
parser_current_line() );
// builtin_print_help( argv[0], sb_err ); // builtin_print_help( argv[0], sb_err );
res = 1; res = 1;
@ -494,10 +489,6 @@ int builtin_complete( wchar_t **argv )
res = 1; res = 1;
} }
else if( load )
{
complete_load( load, 1 );
}
else if( (al_get_count( &cmd) == 0 ) && (al_get_count( &path) == 0 ) ) else if( (al_get_count( &cmd) == 0 ) && (al_get_count( &path) == 0 ) )
{ {
/* No arguments specified, meaning we print the definitions of /* No arguments specified, meaning we print the definitions of

View File

@ -1,2 +1 @@
__fish_complete_bittorrent btdownloadcurses.py
complete -y btdownloadheadless.py

View File

@ -1,33 +1 @@
# Bittorrent commands __fish_complete_bittorrent btdownloadheadless.py
for i in btdownloadcurses.py btdownloadheadless.py;
complete -c $i -l max_uploads -x -d (_ "Maximum uploads at once")
complete -c $i -l keepalive_interval -x -d (_ "Number of seconds between keepalives")
complete -c $i -l download_slice_size -x -d (_ "Bytes per request")
complete -c $i -l request_backlog -x -d (_ "Requests per pipe")
complete -c $i -l max_message_length -x -d (_ "Maximum length prefix encoding")
complete -c $i -l ip -d (_ "IP to report to the tracker") -x -a "(__fish_print_addresses)"
complete -c $i -l minport -d (_ "Minimum port to listen to")
complete -c $i -l maxport -d (_ "Maximum port to listen to")
complete -c $i -l responsefile -r -d (_ "File for server response")
complete -c $i -l url -x -d (_ "URL to get file from")
complete -c $i -l saveas -r -d (_ "Local file target")
complete -c $i -l timeout -x -d (_ "Time to close inactive socket")
complete -c $i -l timeout_check_interval -x -d (_ "Time between checking timeouts")
complete -c $i -l max_slice_length -x -d (_ "Maximum outgoing slice length")
complete -c $i -l max_rate_period -x -d (_ "Maximum time to guess rate")
complete -c $i -l bind -x -d (_ "IP to bind to locally") -a "(__fish_print_addresses)"
complete -c $i -l display_interval -x -d (_ "Time between screen updates")
complete -c $i -l rerequest_interval -x -d (_ "Time to wait between requesting more peers")
complete -c $i -l min_peers -x -d (_ "Minimum number of peers to not do requesting")
complete -c $i -l http_timeout -x -d (_ "Number of seconds before assuming http timeout")
complete -c $i -l max_initiate -x -d (_ "Number of peers at which to stop initiating new connections")
complete -c $i -l max_allow_in -x -d (_ "Maximum number of connections to allow")
complete -c $i -l check_hashes -x -d (_ "Whether to check hashes on disk")
complete -c $i -l max_upload_rate -x -d (_ "Maximum kB/s to upload at")
complete -c $i -l snub_time -x -d (_ "Seconds to wait for data to come in before assuming choking")
complete -c $i -l spew -x -d (_ "Whether to display diagnostic info")
complete -c $i -l rarest_first_cutoff -x -d (_ "Number of downloads at which to switch from random to rarest first")
complete -c $i -l min_uploads -x -d (_ "Number of uploads to fill out to with optimistic unchokes")
complete -c $i -l report_hash_failiures -x -d (_ "Whether to inform the user that hash failures occur")
end;

View File

@ -2,11 +2,6 @@
# Completions for df # Completions for df
# #
#
# Completions for mount define the $__fish_filesystems variable
#
complete -y mount
# #
# Test if we are using GNU sed # Test if we are using GNU sed
# #
@ -19,7 +14,7 @@ __fish_gnu_complete -c df -s i -l inodes -d (_ "List inode information") $is_gnu
__fish_gnu_complete -c df -s k -d (_ "Use 1kB block size") $is_gnu __fish_gnu_complete -c df -s k -d (_ "Use 1kB block size") $is_gnu
__fish_gnu_complete -c df -s l -l local -d (_ "List only local filesystems") $is_gnu __fish_gnu_complete -c df -s l -l local -d (_ "List only local filesystems") $is_gnu
__fish_gnu_complete -c df -s P -l portability -d (_ "Use Posix format") $is_gnu __fish_gnu_complete -c df -s P -l portability -d (_ "Use Posix format") $is_gnu
__fish_gnu_complete -c df -s t -l type -r -d (_ "Show filesystems of specified type") $is_gnu -x -a $__fish_filesystems __fish_gnu_complete -c df -s t -l type -r -d (_ "Show filesystems of specified type") $is_gnu -x -a "(__fish_print_filesystems)"
if test -n "$is_gnu" if test -n "$is_gnu"
@ -29,7 +24,7 @@ if test -n "$is_gnu"
complete -c df -l no-sync -d (_ "Do not sync before getting usage info") complete -c df -l no-sync -d (_ "Do not sync before getting usage info")
complete -c df -l sync -d (_ "Sync before getting usage info") complete -c df -l sync -d (_ "Sync before getting usage info")
complete -c df -s T -l print-type -d (_ "Print filesystem type") complete -c df -s T -l print-type -d (_ "Print filesystem type")
complete -c df -s x -l exclude-type -d (_ "Excluded filesystem type") -r -x -a $__fish_filesystems complete -c df -s x -l exclude-type -d (_ "Excluded filesystem type") -r -x -a "(__fish_print_filesystems)"
complete -c df -l help -d (_ "Display help and exit") complete -c df -l help -d (_ "Display help and exit")
complete -c df -l version -d (_ "Display version and exit") complete -c df -l version -d (_ "Display version and exit")

View File

@ -1 +1,2 @@
complete -y tex __fish_complete_tex elatex

View File

@ -1 +1 @@
complete -y tex __fish_complete_tex etex

View File

@ -1,2 +1,2 @@
complete -y ls __fish_complete_ls la

View File

@ -1 +1,2 @@
complete -y tex __fish_complete_tex latex

View File

@ -1,2 +1,2 @@
complete -y ls __fish_complete_ls ll

View File

@ -1,105 +1,2 @@
#
# Completions for the ls command and its aliases
#
# Test if we are using GNU ls __fish_complete_ls ls
set -l is_gnu
ls --version >/dev/null ^/dev/null; and set is_gnu --is-gnu
set -l cmds -c ls -c ll -c la
# Shared ls switches
__fish_gnu_complete $cmds -s a -l all -d (_ "Show hidden") $is_gnu
__fish_gnu_complete $cmds -s A -l almost-all -d (_ "Show hidden except . and ..") $is_gnu
__fish_gnu_complete $cmds -s F -l classify -d (_ "Append filetype indicator") $is_gnu
__fish_gnu_complete $cmds -s H -l dereference-command-line -d (_ "Follow symlinks") $is_gnu
__fish_gnu_complete $cmds -s L -l dereference -d (_ "Follow symlinks") $is_gnu
__fish_gnu_complete $cmds -s R -l recursive -d (_ "List subdirectory recursively") $is_gnu
__fish_gnu_complete $cmds -s b -l escape -d (_ "Octal escapes for non graphic characters") $is_gnu
__fish_gnu_complete $cmds -s d -l directory -d (_ "List directories, not their content") $is_gnu
__fish_gnu_complete $cmds -s h -l human-readable -d (_ "Human readable sizes") $is_gnu
__fish_gnu_complete $cmds -s i -l inode -d (_ "Print inode number of files") $is_gnu
__fish_gnu_complete $cmds -s n -l numeric-uid-gid -d (_ "Long format, numeric IDs") $is_gnu
__fish_gnu_complete $cmds -s p -l file-type -d (_ "Append filetype indicator") $is_gnu
__fish_gnu_complete $cmds -s q -l hide-control-chars -d (_ "Replace non-graphic characters with '?'") $is_gnu
__fish_gnu_complete $cmds -s r -l reverse -d (_ "Reverse sort order") $is_gnu
__fish_gnu_complete $cmds -s s -l size -d (_ "Print size of files") $is_gnu
complete $cmds -s C -d (_ "List by columns")
complete $cmds -s S -d (_ "Sort by size")
complete $cmds -s c -d (_ "Show and sort by ctime")
complete $cmds -s f -d (_ "Don't sort")
complete $cmds -s g -d (_ "Long format without owner")
complete $cmds -s k -d (_ "Set blocksize to 1kB")
complete $cmds -s l -d (_ "Long format")
complete $cmds -s m -d (_ "Comma separated format")
complete $cmds -s t -d (_ "Sort by modification time")
complete $cmds -s u -d (_ "Show access time")
complete $cmds -s x -d (_ "List entries by lines")
complete $cmds -s 1 -d (_ "List one file per line")
if test -n "$is_gnu"
# GNU specific features
complete $cmds -l author -d (_ "Print author")
complete $cmds -l blocksize -x -d (_ "Set block size")
complete $cmds -s B -l ignore-backups -d (_ "Ignore files ending with ~")
complete $cmds -l color -f -a "never always auto" -d (_ "Use colors")
complete $cmds -s D -l dired -d (_ "Generate dired output")
complete $cmds -l format -x -a "across commas horizontal long single-column verbose vertical" -d (_ "List format")
complete $cmds -l full-time -d (_ "Long format, full-iso time")
complete $cmds -s G -l no-group -d (_ "Don't print group information")
complete $cmds -l si -d (_ "Human readable sizes, powers of 1000")
complete $cmds -l dereference-command-line-symlink-to-dir #-d (_ "Follow directory symlinks from command line")
complete $cmds -l indicator-style -x -a "none classify file-type" -d (_ "Append filetype indicator")
complete $cmds -s I -l ignore -r -d (_ "Skip entries matching pattern")
complete $cmds -s N -l literal -d (_ "Print raw entry names")
complete $cmds -s o -d (_ "Long format without groups")
complete $cmds -l show-control-chars -d (_ "Non graphic as-is")
complete $cmds -s Q -l quote-name -d (_ "Enclose entry in quotes")
complete $cmds -l quoting-style -x -a "literal locale shell shell-always c escape" -d (_ "Select quoting style")
complete $cmds -l sort -x -d (_ "Sort criteria") -a "
extension\t'Sort by file extension'
none\tDon't\ sort
size\t'Sort by size'
time\t'Sort by modification time'
version\t'Sort by version'
status\t'Sort by file status modification time'
atime\t'Sort by access time'
access\t'Sort by access time'
use\t'Sort by access time'
"
complete $cmds -l time -x -d (_ "Show time type") -a "
time\t'Sort by modification time'
access\t'Sort by access time'
use\t'Sort by use time'
ctime\t'Sort by file status modification time'
status\t'Sort by status time'
"
complete $cmds -l time-style -x -a "full-iso long-iso iso locale" -d (_ "Select time style")
complete $cmds -s T -l tabsize -x -a "1 2 3 4 5 6 7 8 9 10 11 12" -d (_ "Assume tab stops at each COLS")
complete $cmds -s U -d (_ "Do not sort")
complete $cmds -s v -d (_ "Sort by version")
complete $cmds -s w -l width -x -d (_ "Assume screen width")
complete $cmds -s X -d (_ "Sort by extension")
complete $cmds -l help -d (_ "Display help and exit")
complete $cmds -l version -d (_ "Display version and exit")
else
# If not a GNU system, assume we have standard BSD ls features instead
complete $cmds -s B -d (_ "Octal escapes for non graphic characters")
complete $cmds -s G -d (_ "Use colors")
complete $cmds -s I -d (_ "Prevent -A from being automatically set for root")
complete $cmds -s P -d (_ "Don't follow symlinks")
complete $cmds -s T -d (_ "Show modification time")
complete $cmds -s W -d (_ "Show whiteouts when scanning directories")
complete $cmds -s Z -d (_ "Display each file's MAC label")
complete $cmds -s o -d (_ "Include the file flags in a long (-l) output")
complete $cmds -s w -d (_ "Print raw entry names")
end

View File

@ -3,44 +3,6 @@
# A list of all known filesystem types, used by various completions, # A list of all known filesystem types, used by various completions,
# including mount and df # including mount and df
set -g __fish_filesystems '
adfs
affs
autofs
coda
coherent
cramfs
devpts
efs
ext
ext2
ext3
hfs
hpfs
iso9660
jfs
minix
msdos
ncpfs
nfs
ntfs
proc
qnx4
ramfs
reiserfs
romfs
smbfs
sysv
tmpfs
udf
ufs
umsdos
vfat
xenix
xfs
xiafs
'
# Completions for mount # Completions for mount
complete -x -c mount -a '(cat /etc/fstab|sed -e "s/^\([^ \t]*\)[ \t]*\([^ \t]*\).*/\1\n\2/"|grep "^/")' -d (_ 'Mount point') complete -x -c mount -a '(cat /etc/fstab|sed -e "s/^\([^ \t]*\)[ \t]*\([^ \t]*\).*/\1\n\2/"|grep "^/")' -d (_ 'Mount point')
complete -c mount -s V -d (_ 'Display version and exit') complete -c mount -s V -d (_ 'Display version and exit')
@ -59,7 +21,7 @@ complete -x -c mount -s U -d (_ 'Mount partition with specified UID')
complete -c mount -s O -x -d (_ 'Exclude filesystems') complete -c mount -s O -x -d (_ 'Exclude filesystems')
complete -c mount -l bind -f -d (_ 'Remount a subtree to a second position') complete -c mount -l bind -f -d (_ 'Remount a subtree to a second position')
complete -c mount -l move -f -d (_ 'Move a subtree to a new position') complete -c mount -l move -f -d (_ 'Move a subtree to a new position')
complete -c mount -x -s t -d (_ 'Filesystem') -a $__fish_filesystems complete -c mount -x -s t -d (_ 'Filesystem') -a "(__fish_print_filesystems)"
complete -c mount -x -s o -d (_ 'Mount option') -a '(__fish_append , $__fish_mount_opts)' complete -c mount -x -s o -d (_ 'Mount option') -a '(__fish_append , $__fish_mount_opts)'

View File

@ -1 +1,2 @@
complete -y tex __fish_complete_tex omega

View File

@ -1 +1,3 @@
complete -y tex __fish_complete_tex pdfelatex

View File

@ -1 +1,3 @@
complete -y tex __fish_complete_tex pdfetex

View File

@ -1 +1,2 @@
complete -y tex __fish_complete_tex pdflatex

View File

@ -1 +1,3 @@
complete -y tex __fish_complete_tex pdftex

View File

@ -2,7 +2,7 @@
# Load common ssh options # Load common ssh options
# #
complete -y ssh __fish_complete_ssh scp
# #
# scp specific completions # scp specific completions

View File

@ -2,12 +2,6 @@
# Completions for the 'set' builtin # Completions for the 'set' builtin
# #
#
# We depend on set_color completions for color definitions
#
complete -y set_color
# #
# All locale variables used by set completions # All locale variables used by set completions
# #

View File

@ -1,69 +1,8 @@
# #
# Common completions for all ssh commands # Load common ssh options
# #
for i in ssh scp __fish_complete_ssh ssh
complete -c $i -s 1 -d (_ "Protocoll version 1 only")
complete -c $i -s 2 -d (_ "Protocoll version 2 only")
complete -c $i -s 4 -d (_ "IPv4 addresses only")
complete -c $i -s 6 -d (_ "IPv6 addresses only")
complete -c $i -s C -d (_ "Compress all data")
complete -xc $i -s c -d (_ "Encryption algorithm") -a "blowfish 3des des"
complete -r -c $i -s F -d (_ "Configuration file")
complete -r -c $i -s i -d (_ "Identity file")
complete -x -c $i -s o -d (_ "Options") -a "
AddressFamily
BatchMode
BindAddress
ChallengeResponseAuthentication
CheckHostIP
Cipher
Ciphers
Compression
CompressionLevel
ConnectionAttempts
ConnectTimeout
ControlMaster
ControlPath
GlobalKnownHostsFile
GSSAPIAuthentication
GSSAPIDelegateCredentials
Host
HostbasedAuthentication
HostKeyAlgorithms
HostKeyAlias
HostName
IdentityFile
IdentitiesOnly
LogLevel
MACs
NoHostAuthenticationForLocalhost
NumberOfPasswordPrompts
PasswordAuthentication
Port
PreferredAuthentications
Protocol
ProxyCommand
PubkeyAuthentication
RhostsRSAAuthentication
RSAAuthentication
SendEnv
ServerAliveInterval
ServerAliveCountMax
SmartcardDevice
StrictHostKeyChecking
TCPKeepAlive
UsePrivilegedPort
User
UserKnownHostsFile
VerifyHostKeyDNS
"
complete -c $i -s v -d (_ "Verbose mode")
end;
#
# ssh specific completions
#
complete -x -c ssh -d Hostname -a " complete -x -c ssh -d Hostname -a "

View File

@ -1,7 +1,5 @@
set -l cmds -c etex -c tex -c elatex -c latex -c pdflatex -c pdfelatex -c pdftex -c pdfetex -c omega
complete $cmds -o help -d (_ "Display help and exit") set -l cmds -c etex -c tex -c elatex -c latex -c pdflatex -c pdfelatex -c pdftex -c pdfetex -c omega
complete $cmds -o version -d (_ "Display version and exit")
complete $cmds -x -a "( __fish_complete_tex tex
__fish_complete_suffix (commandline -ct) .tex '(La)TeX file'
)"

View File

@ -2,11 +2,6 @@
# Completions for the umount command # Completions for the umount command
# #
#
# Depends on mount for $__fish_filesystems
#
complete -y mount
# #
# Find all mountpoints # Find all mountpoints
# #
@ -20,7 +15,7 @@ complete -c umount -s r -d (_ "In case unmounting fails, try to remount read-onl
complete -c umount -s d -d (_ "In case the unmounted device was a loop device, also free this loop device") complete -c umount -s d -d (_ "In case the unmounted device was a loop device, also free this loop device")
complete -c umount -s i -d (_ "Don't call the /sbin/umount.<filesystem> helper even if it exists") complete -c umount -s i -d (_ "Don't call the /sbin/umount.<filesystem> helper even if it exists")
complete -c umount -s a -d (_ "Unmount all of the file systems described in /etc/mtab") complete -c umount -s a -d (_ "Unmount all of the file systems described in /etc/mtab")
complete -c umount -s t -d (_ "Actions should only be taken on file systems of the specified type") -xa $__fish_filesystems complete -c umount -s t -d (_ "Actions should only be taken on file systems of the specified type") -xa "(__fish_print_filesystems)"
complete -c umount -s O -d (_ "Actions should only be taken on file systems with the specified options in /etc/fstab") -xa '(cat /etc/mtab | cut -d " " -f 4)\t"Mount option"' complete -c umount -s O -d (_ "Actions should only be taken on file systems with the specified options in /etc/fstab") -xa '(cat /etc/mtab | cut -d " " -f 4)\t"Mount option"'
complete -c umount -s f -d (_ "Force unmount (in case of an unreachable NFS system)") complete -c umount -s f -d (_ "Force unmount (in case of an unreachable NFS system)")
complete -c umount -s l -d (_ "Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy") complete -c umount -s l -d (_ "Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy")

View File

@ -1,3 +1,2 @@
complete -y man
complete -xc whatis -a "(__fish_complete_man)" complete -xc whatis -a "(__fish_complete_man)"

View File

@ -2,9 +2,6 @@
# Completions for the yum command # Completions for the yum command
# #
#Load rpm completions, since that is where the package completion function is defined
complete -y rpm
#All yum commands #All yum commands
#Test if the yum command has been specified #Test if the yum command has been specified

View File

@ -0,0 +1,33 @@
# Bittorrent commands
function __fish_complete_bittorrent
complete -c $argv -l max_uploads -x -d (_ "Maximum uploads at once")
complete -c $argv -l keepalive_interval -x -d (_ "Number of seconds between keepalives")
complete -c $argv -l download_slice_size -x -d (_ "Bytes per request")
complete -c $argv -l request_backlog -x -d (_ "Requests per pipe")
complete -c $argv -l max_message_length -x -d (_ "Maximum length prefix encoding")
complete -c $argv -l ip -d (_ "IP to report to the tracker") -x -a "(__fish_print_addresses)"
complete -c $argv -l minport -d (_ "Minimum port to listen to")
complete -c $argv -l maxport -d (_ "Maximum port to listen to")
complete -c $argv -l responsefile -r -d (_ "File for server response")
complete -c $argv -l url -x -d (_ "URL to get file from")
complete -c $argv -l saveas -r -d (_ "Local file target")
complete -c $argv -l timeout -x -d (_ "Time to close inactive socket")
complete -c $argv -l timeout_check_interval -x -d (_ "Time between checking timeouts")
complete -c $argv -l max_slice_length -x -d (_ "Maximum outgoing slice length")
complete -c $argv -l max_rate_period -x -d (_ "Maximum time to guess rate")
complete -c $argv -l bind -x -d (_ "IP to bind to locally") -a "(__fish_print_addresses)"
complete -c $argv -l display_interval -x -d (_ "Time between screen updates")
complete -c $argv -l rerequest_interval -x -d (_ "Time to wait between requesting more peers")
complete -c $argv -l min_peers -x -d (_ "Minimum number of peers to not do requesting")
complete -c $argv -l http_timeout -x -d (_ "Number of seconds before assuming http timeout")
complete -c $argv -l max_initiate -x -d (_ "Number of peers at which to stop initiating new connections")
complete -c $argv -l max_allow_in -x -d (_ "Maximum number of connections to allow")
complete -c $argv -l check_hashes -x -d (_ "Whether to check hashes on disk")
complete -c $argv -l max_upload_rate -x -d (_ "Maximum kB/s to upload at")
complete -c $argv -l snub_time -x -d (_ "Seconds to wait for data to come in before assuming choking")
complete -c $argv -l spew -x -d (_ "Whether to display diagnostic info")
complete -c $argv -l rarest_first_cutoff -x -d (_ "Number of downloads at which to switch from random to rarest first")
complete -c $argv -l min_uploads -x -d (_ "Number of uploads to fill out to with optimistic unchokes")
complete -c $argv -l report_hash_failiures -x -d (_ "Whether to inform the user that hash failures occur")
end

View File

@ -0,0 +1,109 @@
#
# Completions for the ls command and its aliases
#
# Test if we are using GNU ls
function __fish_complete_ls -d "Compleletions for ls and it's aliases"
set -l is_gnu
ls --version >/dev/null ^/dev/null; and set is_gnu --is-gnu
set -l cmds -c $argv
# Shared ls switches
__fish_gnu_complete $cmds -s a -l all -d (_ "Show hidden") $is_gnu
__fish_gnu_complete $cmds -s A -l almost-all -d (_ "Show hidden except . and ..") $is_gnu
__fish_gnu_complete $cmds -s F -l classify -d (_ "Append filetype indicator") $is_gnu
__fish_gnu_complete $cmds -s H -l dereference-command-line -d (_ "Follow symlinks") $is_gnu
__fish_gnu_complete $cmds -s L -l dereference -d (_ "Follow symlinks") $is_gnu
__fish_gnu_complete $cmds -s R -l recursive -d (_ "List subdirectory recursively") $is_gnu
__fish_gnu_complete $cmds -s b -l escape -d (_ "Octal escapes for non graphic characters") $is_gnu
__fish_gnu_complete $cmds -s d -l directory -d (_ "List directories, not their content") $is_gnu
__fish_gnu_complete $cmds -s h -l human-readable -d (_ "Human readable sizes") $is_gnu
__fish_gnu_complete $cmds -s i -l inode -d (_ "Print inode number of files") $is_gnu
__fish_gnu_complete $cmds -s n -l numeric-uid-gid -d (_ "Long format, numeric IDs") $is_gnu
__fish_gnu_complete $cmds -s p -l file-type -d (_ "Append filetype indicator") $is_gnu
__fish_gnu_complete $cmds -s q -l hide-control-chars -d (_ "Replace non-graphic characters with '?'") $is_gnu
__fish_gnu_complete $cmds -s r -l reverse -d (_ "Reverse sort order") $is_gnu
__fish_gnu_complete $cmds -s s -l size -d (_ "Print size of files") $is_gnu
complete $cmds -s C -d (_ "List by columns")
complete $cmds -s S -d (_ "Sort by size")
complete $cmds -s c -d (_ "Show and sort by ctime")
complete $cmds -s f -d (_ "Don't sort")
complete $cmds -s g -d (_ "Long format without owner")
complete $cmds -s k -d (_ "Set blocksize to 1kB")
complete $cmds -s l -d (_ "Long format")
complete $cmds -s m -d (_ "Comma separated format")
complete $cmds -s t -d (_ "Sort by modification time")
complete $cmds -s u -d (_ "Show access time")
complete $cmds -s x -d (_ "List entries by lines")
complete $cmds -s 1 -d (_ "List one file per line")
if test -n "$is_gnu"
# GNU specific features
complete $cmds -l author -d (_ "Print author")
complete $cmds -l blocksize -x -d (_ "Set block size")
complete $cmds -s B -l ignore-backups -d (_ "Ignore files ending with ~")
complete $cmds -l color -f -a "never always auto" -d (_ "Use colors")
complete $cmds -s D -l dired -d (_ "Generate dired output")
complete $cmds -l format -x -a "across commas horizontal long single-column verbose vertical" -d (_ "List format")
complete $cmds -l full-time -d (_ "Long format, full-iso time")
complete $cmds -s G -l no-group -d (_ "Don't print group information")
complete $cmds -l si -d (_ "Human readable sizes, powers of 1000")
complete $cmds -l dereference-command-line-symlink-to-dir #-d (_ "Follow directory symlinks from command line")
complete $cmds -l indicator-style -x -a "none classify file-type" -d (_ "Append filetype indicator")
complete $cmds -s I -l ignore -r -d (_ "Skip entries matching pattern")
complete $cmds -s N -l literal -d (_ "Print raw entry names")
complete $cmds -s o -d (_ "Long format without groups")
complete $cmds -l show-control-chars -d (_ "Non graphic as-is")
complete $cmds -s Q -l quote-name -d (_ "Enclose entry in quotes")
complete $cmds -l quoting-style -x -a "literal locale shell shell-always c escape" -d (_ "Select quoting style")
complete $cmds -l sort -x -d (_ "Sort criteria") -a "
extension\t'Sort by file extension'
none\tDon't\ sort
size\t'Sort by size'
time\t'Sort by modification time'
version\t'Sort by version'
status\t'Sort by file status modification time'
atime\t'Sort by access time'
access\t'Sort by access time'
use\t'Sort by access time'
"
complete $cmds -l time -x -d (_ "Show time type") -a "
time\t'Sort by modification time'
access\t'Sort by access time'
use\t'Sort by use time'
ctime\t'Sort by file status modification time'
status\t'Sort by status time'
"
complete $cmds -l time-style -x -a "full-iso long-iso iso locale" -d (_ "Select time style")
complete $cmds -s T -l tabsize -x -a "1 2 3 4 5 6 7 8 9 10 11 12" -d (_ "Assume tab stops at each COLS")
complete $cmds -s U -d (_ "Do not sort")
complete $cmds -s v -d (_ "Sort by version")
complete $cmds -s w -l width -x -d (_ "Assume screen width")
complete $cmds -s X -d (_ "Sort by extension")
complete $cmds -l help -d (_ "Display help and exit")
complete $cmds -l version -d (_ "Display version and exit")
else
# If not a GNU system, assume we have standard BSD ls features instead
complete $cmds -s B -d (_ "Octal escapes for non graphic characters")
complete $cmds -s G -d (_ "Use colors")
complete $cmds -s I -d (_ "Prevent -A from being automatically set for root")
complete $cmds -s P -d (_ "Don't follow symlinks")
complete $cmds -s T -d (_ "Show modification time")
complete $cmds -s W -d (_ "Show whiteouts when scanning directories")
complete $cmds -s Z -d (_ "Display each file's MAC label")
complete $cmds -s o -d (_ "Include the file flags in a long (-l) output")
complete $cmds -s w -d (_ "Print raw entry names")
end
end

View File

@ -0,0 +1,27 @@
function __fish_complete_man
if test (commandline -ct)
# Try to guess what section to search in. If we don't know, we
# use [^)]*, which should match any section
set section ""
set prev (commandline -poc)
set -e prev[1]
while count $prev
switch $prev[1]
case '-**'
case '*'
set section $prev[1]
end
set -e prev[1]
end
set section $section"[^)]*"
# Do the actual search
apropos (commandline -ct) | grep \^(commandline -ct) | sed -n -e 's/\([^ ]*\).*(\('$section'\)) *- */\1\t\2: /p'
end
end

View File

@ -0,0 +1,61 @@
function __fish_complete_ssh -d "common completions for ssh commands"
complete -c $argv -s 1 -d (_ "Protocoll version 1 only")
complete -c $argv -s 2 -d (_ "Protocoll version 2 only")
complete -c $argv -s 4 -d (_ "IPv4 addresses only")
complete -c $argv -s 6 -d (_ "IPv6 addresses only")
complete -c $argv -s C -d (_ "Compress all data")
complete -xc $argv -s c -d (_ "Encryption algorithm") -a "blowfish 3des des"
complete -r -c $argv -s F -d (_ "Configuration file")
complete -r -c $argv -s i -d (_ "Identity file")
complete -x -c $argv -s o -d (_ "Options") -a "
AddressFamily
BatchMode
BindAddress
ChallengeResponseAuthentication
CheckHostIP
Cipher
Ciphers
Compression
CompressionLevel
ConnectionAttempts
ConnectTimeout
ControlMaster
ControlPath
GlobalKnownHostsFile
GSSAPIAuthentication
GSSAPIDelegateCredentials
Host
HostbasedAuthentication
HostKeyAlgorithms
HostKeyAlias
HostName
IdentityFile
IdentitiesOnly
LogLevel
MACs
NoHostAuthenticationForLocalhost
NumberOfPasswordPrompts
PasswordAuthentication
Port
PreferredAuthentications
Protocol
ProxyCommand
PubkeyAuthentication
RhostsRSAAuthentication
RSAAuthentication
SendEnv
ServerAliveInterval
ServerAliveCountMax
SmartcardDevice
StrictHostKeyChecking
TCPKeepAlive
UsePrivilegedPort
User
UserKnownHostsFile
VerifyHostKeyDNS
"
complete -c $argv -s v -d (_ "Verbose mode")
end

View File

@ -0,0 +1,10 @@
function __fish_complete_tex -d "Common completions for all tex commands"
complete -c $argv -o help -d (_ "Display help and exit")
complete -c $argv -o version -d (_ "Display version and exit")
complete -c $argv -x -a "(
__fish_complete_suffix (commandline -ct) .tex '(La)TeX file'
)"
end

View File

@ -0,0 +1,8 @@
function __fish_print_filesystems -d "Print a list of all known filesystem types"
set -l fs adfs affs autofs coda coherent cramfs devpts efs ext ext2 ext3
set fs $fs hfs hpfs iso9660 jfs minix msdos ncpfs nfs ntfs proc qnx4 ramfs
set fs $fs reiserfs romfs smbfs sysv tmpfs udf ufs umsdos vfat xenix xfs xiafs
printf "%s\n" $fs
end

7
init/functions/la.fish Normal file
View File

@ -0,0 +1,7 @@
#
# These are very common and useful
#
function la -d "List contents, including hidden fiels in directory using long format"
ls -lah $argv
end