mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
completion helper functions: do not use gettext
remove package
This commit is contained in:
parent
12ce66684e
commit
b4626468ec
|
@ -5,7 +5,7 @@
|
|||
#
|
||||
function __fish_complete_directories -d "Complete directory prefixes" --argument comp desc
|
||||
if not set -q desc[1]
|
||||
set desc (_ "Directory")
|
||||
set desc "Directory"
|
||||
end
|
||||
|
||||
if not set -q comp[1]
|
||||
|
|
|
@ -13,17 +13,17 @@ function __fish_complete_zfs_mountpoint_properties -d "Completes with ZFS mountp
|
|||
case "*"
|
||||
set OS "unknown"
|
||||
end
|
||||
echo -e "atime\t"(_ "Update access time on read")" (on, off)"
|
||||
echo -e "devices\t"(_ "Are contained device nodes openable")" (on, off)"
|
||||
echo -e "exec\t"(_ "Can contained executables be executed")" (on, off)"
|
||||
echo -e "readonly\t"(_ "Read-only")" (on, off)"
|
||||
echo -e "setuid\t"(_ "Respect set-UID bit")" (on, off)"
|
||||
echo -e "atime\tUpdate access time on read (on, off)"
|
||||
echo -e "devices\tAre contained device nodes openable (on, off)"
|
||||
echo -e "exec\tCan contained executables be executed (on, off)"
|
||||
echo -e "readonly\tRead-only (on, off)"
|
||||
echo -e "setuid\tRespect set-UID bit (on, off)"
|
||||
if test $OS = "SunOS"
|
||||
echo -e "nbmand\t"(_ "Mount with Non Blocking mandatory locks")" (on, off)"
|
||||
echo -e "xattr\t"(_ "Extended attributes")" (on, off, sa)"
|
||||
echo -e "nbmand\tMount with Non Blocking mandatory locks (on, off)"
|
||||
echo -e "xattr\tExtended attributes (on, off, sa)"
|
||||
else if test $OS = "Linux"
|
||||
echo -e "nbmand\t"(_ "Mount with Non Blocking mandatory locks")" (on, off)"
|
||||
echo -e "relatime\t"(_ "Sometimes update access time on read")" (on, off)"
|
||||
echo -e "xattr\t"(_ "Extended attributes")" (on, off, sa)"
|
||||
echo -e "nbmand\tMount with Non Blocking mandatory locks (on, off)"
|
||||
echo -e "relatime\tSometimes update access time on read (on, off)"
|
||||
echo -e "xattr\tExtended attributes (on, off, sa)"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
function __fish_complete_zfs_ro_properties -d "Completes with ZFS read-only properties"
|
||||
echo -e "available\t"(_ "Available space")
|
||||
echo -e "avail\t"(_ "Available space")
|
||||
echo -e "compressratio\t"(_ "Achieved compression ratio")
|
||||
echo -e "creation\t"(_ "Dataset creation time")
|
||||
echo -e "clones\t"(_ "Snapshot clones")
|
||||
echo -e "defer_destroy\t"(_ "Marked for deferred destruction")
|
||||
echo -e "filesystem_count\t"(_ "Total lower-level filesystems and volumes")
|
||||
echo -e "logicalreferenced\t"(_ "Logical total space")
|
||||
echo -e "lrefer\t"(_ "Logical total space")
|
||||
echo -e "logicalused\t"(_ "Logical used space")
|
||||
echo -e "lused\t"(_ "Logical used space")
|
||||
echo -e "mounted\t"(_ "Is currently mounted?")
|
||||
echo -e "origin\t"(_ "Source snapshot")
|
||||
echo -e "available\tAvailable space"
|
||||
echo -e "avail\tAvailable space"
|
||||
echo -e "compressratio\tAchieved compression ratio"
|
||||
echo -e "creation\tDataset creation time"
|
||||
echo -e "clones\tSnapshot clones"
|
||||
echo -e "defer_destroy\tMarked for deferred destruction"
|
||||
echo -e "filesystem_count\tTotal lower-level filesystems and volumes"
|
||||
echo -e "logicalreferenced\tLogical total space"
|
||||
echo -e "lrefer\tLogical total space"
|
||||
echo -e "logicalused\tLogical used space"
|
||||
echo -e "lused\tLogical used space"
|
||||
echo -e "mounted\tIs currently mounted?"
|
||||
echo -e "origin\tSource snapshot"
|
||||
if __fish_is_zfs_feature_enabled "feature@extensible_dataset"
|
||||
echo -e "receive_resume_token\t"(_ "Token for interrupted reception resumption")
|
||||
echo -e "receive_resume_token\tToken for interrupted reception resumption"
|
||||
end
|
||||
echo -e "referenced\t"(_ "Total space")
|
||||
echo -e "refer\t"(_ "Total space")
|
||||
echo -e "refcompressratio\t"(_ "Achieved compression ratio of referenced space")
|
||||
echo -e "snapshot_count\t"(_ "Total lower-level snapshots")
|
||||
echo -e "type\t"(_ "Dataset type")
|
||||
echo -e "used\t"(_ "Space used by dataset and children")
|
||||
echo -e "usedbychildren\t"(_ "Space used by children datasets")
|
||||
echo -e "usedbydataset\t"(_ "Space used by dataset itself")
|
||||
echo -e "usedbyrefreservation\t"(_ "Space used by refreservation")
|
||||
echo -e "usedbysnapshots\t"(_ "Space used by dataset snapshots")
|
||||
echo -e "userrefs\t"(_ "Holds count")
|
||||
echo -e "volblocksize\t"(_ "Volume block size")
|
||||
echo -e "written\t"(_ "Referenced data written since previous snapshot")
|
||||
echo -e "referenced\tTotal space"
|
||||
echo -e "refer\tTotal space"
|
||||
echo -e "refcompressratio\tAchieved compression ratio of referenced space"
|
||||
echo -e "snapshot_count\tTotal lower-level snapshots"
|
||||
echo -e "type\tDataset type"
|
||||
echo -e "used\tSpace used by dataset and children"
|
||||
echo -e "usedbychildren\tSpace used by children datasets"
|
||||
echo -e "usedbydataset\tSpace used by dataset itself"
|
||||
echo -e "usedbyrefreservation\tSpace used by refreservation"
|
||||
echo -e "usedbysnapshots\tSpace used by dataset snapshots"
|
||||
echo -e "userrefs\tHolds count"
|
||||
echo -e "volblocksize\tVolume block size"
|
||||
echo -e "written\tReferenced data written since previous snapshot"
|
||||
# Autogenerate userused@$USER list; only usernames are supported by the completion, but the zfs command supports more formats
|
||||
for user in (__fish_print_users)
|
||||
set -l tabAndBefore (echo -e "userused@$user\t")
|
||||
printf (_ "%sDataset space use by user %s\n") $tabAndBefore $user
|
||||
printf "%sDataset space use by user %s\n" $tabAndBefore $user
|
||||
end
|
||||
# Autogenerate groupused@$USER list
|
||||
for group in (__fish_print_groups)
|
||||
set -l tabAndBefore (echo -e "groupused@$group\t")
|
||||
printf (_ "%sDataset space use by group %s\n") $tabAndBefore $group
|
||||
printf "%sDataset space use by group %s\n" $tabAndBefore $group
|
||||
end
|
||||
# Autogenerate written@$SNAPSHOT list
|
||||
for snapshot in (__fish_print_zfs_snapshots)
|
||||
set -l tabAndBefore (echo -e "written@$snapshot\t")
|
||||
printf (_ "%sReferenced data written since snapshot %s\n") $tabAndBefore $snapshot
|
||||
printf "%sReferenced data written since snapshot %s\n" $tabAndBefore $snapshot
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,9 +13,9 @@ function __fish_complete_zfs_rw_properties -d "Completes with ZFS read-write pro
|
|||
case "*"
|
||||
set OS "unknown"
|
||||
end
|
||||
echo -e "aclinherit\t"(_ "Inheritance of ACL entries")" (discard, noallow, restricted, passthrough, passthrough-x)"
|
||||
echo -e "atime\t"(_ "Update access time on read")" (on, off)"
|
||||
echo -e "canmount\t"(_ "Is the dataset mountable")" (on, off, noauto)"
|
||||
echo -e "aclinherit\tInheritance of ACL entries (discard, noallow, restricted, passthrough, passthrough-x)"
|
||||
echo -e "atime\tUpdate access time on read (on, off)"
|
||||
echo -e "canmount\tIs the dataset mountable (on, off, noauto)"
|
||||
set -l additional_algs ''
|
||||
if contains -- $OS FreeBSD SunOS
|
||||
set additional_algs "$additional_algs, noparity"
|
||||
|
@ -29,68 +29,68 @@ function __fish_complete_zfs_rw_properties -d "Completes with ZFS read-write pro
|
|||
if __fish_is_zfs_feature_enabled "feature@edonr"
|
||||
set additional_algs "$additional_algs, edonr"
|
||||
end
|
||||
echo -e "checksum\t"(_ "Data checksum")" (on, off, fletcher2, fletcher4, sha256$additional_algs)"
|
||||
echo -e "checksum\tData checksum (on, off, fletcher2, fletcher4, sha256$additional_algs)"
|
||||
if __fish_is_zfs_feature_enabled "feature@lz4_compress"
|
||||
set additional_algs ", lz4"
|
||||
end
|
||||
echo -e "compression\t"(_ "Compression algorithm")" (on, off, lzjb$additional_algs, gzip, gzip-[1-9], zle)"
|
||||
echo -e "compression\tCompression algorithm (on, off, lzjb$additional_algs, gzip, gzip-[1-9], zle)"
|
||||
set -e additional_algs
|
||||
echo -e "copies\t"(_ "Number of copies of data")" (1, 2, 3)"
|
||||
echo -e "dedup\t"(_ "Deduplication")" (on, off, verify, sha256[,verify])"
|
||||
echo -e "devices\t"(_ "Are contained device nodes openable")" (on, off)"
|
||||
echo -e "exec\t"(_ "Can contained executables be executed")" (on, off)"
|
||||
echo -e "filesystem_limit\t"(_ "Max number of filesystems and volumes")" (COUNT, none)"
|
||||
echo -e "mountpoint\t"(_ "Mountpoint")" (PATH, none, legacy)"
|
||||
echo -e "primarycache\t"(_ "Which data to cache in ARC")" (all, none, metadata)"
|
||||
echo -e "quota\t"(_ "Max size of dataset and children")" (SIZE, none)"
|
||||
echo -e "snapshot_limit\t"(_ "Max number of snapshots")" (COUNT, none)"
|
||||
echo -e "readonly\t"(_ "Read-only")" (on, off)"
|
||||
echo -e "recordsize\t"(_ "Suggest block size")" (SIZE)"
|
||||
echo -e "redundant_metadata\t"(_ "How redundant are the metadata")" (all, most)"
|
||||
echo -e "refquota\t"(_ "Max space used by dataset itself")" (SIZE, none)"
|
||||
echo -e "refreservation\t"(_ "Min space guaranteed to dataset itself")" (SIZE, none)"
|
||||
echo -e "reservation\t"(_ "Min space guaranteed to dataset")" (SIZE, none)"
|
||||
echo -e "secondarycache\t"(_ "Which data to cache in L2ARC")" (all, none, metadata)"
|
||||
echo -e "setuid\t"(_ "Respect set-UID bit")" (on, off)"
|
||||
echo -e "sharenfs\t"(_ "Share in NFS")" (on, off, OPTS)"
|
||||
echo -e "logbias\t"(_ "Hint for handling of synchronous requests")" (latency, throughput)"
|
||||
echo -e "snapdir\t"(_ "Hide .zfs directory")" (hidden, visible)"
|
||||
echo -e "sync\t"(_ "Handle of synchronous requests")" (standard, always, disabled)"
|
||||
echo -e "volsize\t"(_ "Volume logical size")" (SIZE)"
|
||||
echo -e "copies\tNumber of copies of data (1, 2, 3)"
|
||||
echo -e "dedup\tDeduplication (on, off, verify, sha256[,verify])"
|
||||
echo -e "devices\tAre contained device nodes openable (on, off)"
|
||||
echo -e "exec\tCan contained executables be executed (on, off)"
|
||||
echo -e "filesystem_limit\tMax number of filesystems and volumes (COUNT, none)"
|
||||
echo -e "mountpoint\tMountpoint (PATH, none, legacy)"
|
||||
echo -e "primarycache\tWhich data to cache in ARC (all, none, metadata)"
|
||||
echo -e "quota\tMax size of dataset and children (SIZE, none)"
|
||||
echo -e "snapshot_limit\tMax number of snapshots (COUNT, none)"
|
||||
echo -e "readonly\tRead-only (on, off)"
|
||||
echo -e "recordsize\tSuggest block size (SIZE)"
|
||||
echo -e "redundant_metadata\tHow redundant are the metadata (all, most)"
|
||||
echo -e "refquota\tMax space used by dataset itself (SIZE, none)"
|
||||
echo -e "refreservation\tMin space guaranteed to dataset itself (SIZE, none)"
|
||||
echo -e "reservation\tMin space guaranteed to dataset (SIZE, none)"
|
||||
echo -e "secondarycache\tWhich data to cache in L2ARC (all, none, metadata)"
|
||||
echo -e "setuid\tRespect set-UID bit (on, off)"
|
||||
echo -e "sharenfs\tShare in NFS (on, off, OPTS)"
|
||||
echo -e "logbias\tHint for handling of synchronous requests (latency, throughput)"
|
||||
echo -e "snapdir\tHide .zfs directory (hidden, visible)"
|
||||
echo -e "sync\tHandle of synchronous requests (standard, always, disabled)"
|
||||
echo -e "volsize\tVolume logical size (SIZE)"
|
||||
|
||||
# Autogenerate userquota@$USER list; only usernames are supported by the completion, but the zfs command supports more formats
|
||||
for user in (__fish_print_users)
|
||||
set -l tabAndBefore (echo -e "userquota@$user\t")
|
||||
printf (_ "%sMax usage by user %s\n") $tabAndBefore $user
|
||||
printf "%sMax usage by user %s\n" $tabAndBefore $user
|
||||
end
|
||||
# Autogenerate groupquota@$USER list
|
||||
for group in (__fish_print_groups)
|
||||
set -l tabAndBefore (echo -e "groupquota@$group\t")
|
||||
printf (_ "%sMax usage by group %s\n") $tabAndBefore $group
|
||||
printf "%sMax usage by group %s\n" $tabAndBefore $group
|
||||
end
|
||||
if test $OS = "SunOS"
|
||||
echo -e "aclmode\t"(_ "How is ACL modified by chmod")" (discard, groupmask, passthrough, restricted)"
|
||||
echo -e "mlslabel\t"(_ "Can the dataset be mounted in a zone with Trusted Extensions enabled")" (LABEL, none)"
|
||||
echo -e "nbmand\t"(_ "Mount with Non Blocking mandatory locks")" (on, off)"
|
||||
echo -e "sharesmb\t"(_ "Share in Samba")" (on, off)"
|
||||
echo -e "shareiscsi\t"(_ "Share as an iSCSI target")" (on, off)"
|
||||
echo -e "version\t"(_ "On-disk version of filesystem")" (1, 2, current)"
|
||||
echo -e "vscan\t"(_ "Scan regular files for viruses on opening and closing")" (on, off)"
|
||||
echo -e "xattr\t"(_ "Extended attributes")" (on, off, sa)"
|
||||
echo -e "zoned\t"(_ "Managed from a non-global zone")" (on, off)"
|
||||
echo -e "aclmode\tHow is ACL modified by chmod (discard, groupmask, passthrough, restricted)"
|
||||
echo -e "mlslabel\tCan the dataset be mounted in a zone with Trusted Extensions enabled (LABEL, none)"
|
||||
echo -e "nbmand\tMount with Non Blocking mandatory locks (on, off)"
|
||||
echo -e "sharesmb\tShare in Samba (on, off)"
|
||||
echo -e "shareiscsi\tShare as an iSCSI target (on, off)"
|
||||
echo -e "version\tOn-disk version of filesystem (1, 2, current)"
|
||||
echo -e "vscan\tScan regular files for viruses on opening and closing (on, off)"
|
||||
echo -e "xattr\tExtended attributes (on, off, sa)"
|
||||
echo -e "zoned\tManaged from a non-global zone (on, off)"
|
||||
else if test $OS = "Linux"
|
||||
echo -e "acltype\t"(_ "Use no ACL or POSIX ACL")" (noacl, posixacl)"
|
||||
echo -e "nbmand\t"(_ "Mount with Non Blocking mandatory locks")" (on, off)"
|
||||
echo -e "relatime\t"(_ "Sometimes update access time on read")" (on, off)"
|
||||
echo -e "shareiscsi\t"(_ "Share as an iSCSI target")" (on, off)"
|
||||
echo -e "sharesmb\t"(_ "Share in Samba")" (on, off)"
|
||||
echo -e "snapdev\t"(_ "Hide volume snapshots")" (hidden, visible)"
|
||||
echo -e "version\t"(_ "On-disk version of filesystem")" (1, 2, current)"
|
||||
echo -e "vscan\t"(_ "Scan regular files for viruses on opening and closing")" (on, off)"
|
||||
echo -e "xattr\t"(_ "Extended attributes")" (on, off, sa)"
|
||||
echo -e "acltype\tUse no ACL or POSIX ACL (noacl, posixacl)"
|
||||
echo -e "nbmand\tMount with Non Blocking mandatory locks (on, off)"
|
||||
echo -e "relatime\tSometimes update access time on read (on, off)"
|
||||
echo -e "shareiscsi\tShare as an iSCSI target (on, off)"
|
||||
echo -e "sharesmb\tShare in Samba (on, off)"
|
||||
echo -e "snapdev\tHide volume snapshots (hidden, visible)"
|
||||
echo -e "version\tOn-disk version of filesystem (1, 2, current)"
|
||||
echo -e "vscan\tScan regular files for viruses on opening and closing (on, off)"
|
||||
echo -e "xattr\tExtended attributes (on, off, sa)"
|
||||
else if test $OS = "FreeBSD"
|
||||
echo -e "aclmode\t"(_ "How is ACL modified by chmod")" (discard, groupmask, passthrough, restricted)"
|
||||
echo -e "volmode\t"(_ "How to expose volumes to OS")" (default, geom, dev, none)"
|
||||
echo -e "aclmode\tHow is ACL modified by chmod (discard, groupmask, passthrough, restricted)"
|
||||
echo -e "volmode\tHow to expose volumes to OS (default, geom, dev, none)"
|
||||
end
|
||||
# User properties; the /dev/null redirection masks the possible "no datasets available"
|
||||
zfs list -o all 2>/dev/null | head -n 1 | string replace -a -r "\s+" "\n" | string match -e ":" | string lower
|
||||
|
|
|
@ -13,18 +13,18 @@ function __fish_complete_zfs_write_once_properties -d "Completes with ZFS proper
|
|||
case "*"
|
||||
set OS "unknown"
|
||||
end
|
||||
echo -e "normalization\t"(_ "Unicode normalization")" (none, formC, formD, formKC, formKD)"
|
||||
echo -e "utf8only\t"(_ "Reject non-UTF-8-compliant filenames")" (on, off)"
|
||||
echo -e "normalization\tUnicode normalization (none, formC, formD, formKC, formKD)"
|
||||
echo -e "utf8only\tReject non-UTF-8-compliant filenames (on, off)"
|
||||
if test $OS = "Linux"
|
||||
echo -e "overlay\t"(_ "Allow overlay mount")" (on, off)"
|
||||
echo -e "overlay\tAllow overlay mount (on, off)"
|
||||
if command -sq sestatus # SELinux is enabled
|
||||
echo -e "context\t"(_ "SELinux context for the child filesystem")
|
||||
echo -e "fscontext\t"(_ "SELinux context for the filesystem being mounted")
|
||||
echo -e "defcontext\t"(_ "SELinux context for unlabeled files")
|
||||
echo -e "rootcontext\t"(_ "SELinux context for the root inode of the filesystem")
|
||||
echo -e "context\tSELinux context for the child filesystem"
|
||||
echo -e "fscontext\tSELinux context for the filesystem being mounted"
|
||||
echo -e "defcontext\tSELinux context for unlabeled files"
|
||||
echo -e "rootcontext\tSELinux context for the root inode of the filesystem"
|
||||
end
|
||||
echo -e "casesensitivity\t"(_ "Case sensitivity")" (sensitive, insensitive)"
|
||||
echo -e "casesensitivity\tCase sensitivity (sensitive, insensitive)"
|
||||
else
|
||||
echo -e "casesensitivity\t"(_ "Case sensitivity")" (sensitive, insensitive, mixed)"
|
||||
echo -e "casesensitivity\tCase sensitivity (sensitive, insensitive, mixed)"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,9 +16,6 @@ function __fish_print_packages
|
|||
return
|
||||
end
|
||||
|
||||
#Get the word 'Package' in the current language
|
||||
set -l package (_ "Package")
|
||||
|
||||
if type -q -f apt-cache
|
||||
if not set -q only_installed
|
||||
# Do not generate the cache as apparently sometimes this is slow.
|
||||
|
@ -74,7 +71,7 @@ function __fish_print_packages
|
|||
end
|
||||
|
||||
# prints: <package name> Package
|
||||
pacman -Ssq | sed -e 's/$/\t'$package'/' >$cache_file &
|
||||
pacman -Ssq | sed -e 's/$/\t'Package'/' >$cache_file &
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -82,7 +79,7 @@ function __fish_print_packages
|
|||
if type -q -f zypper
|
||||
# Use libzypp cache file if available
|
||||
if test -f /var/cache/zypp/solv/@System/solv.idx
|
||||
awk '!/application:|srcpackage:|product:|pattern:|patch:/ {print $1'\t$package'}' /var/cache/zypp/solv/*/solv.idx
|
||||
awk '!/application:|srcpackage:|product:|pattern:|patch:/ {print $1'\tPackage'}' /var/cache/zypp/solv/*/solv.idx
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -99,7 +96,7 @@ function __fish_print_packages
|
|||
end
|
||||
|
||||
# Remove package version information from output and pipe into cache file
|
||||
zypper --quiet --non-interactive search --type=package | tail -n +4 | sed -r 's/^. \| ((\w|[-_.])+).*/\1\t'$package'/g' >$cache_file &
|
||||
zypper --quiet --non-interactive search --type=package | tail -n +4 | sed -r 's/^. \| ((\w|[-_.])+).*/\1\t'Package'/g' >$cache_file &
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -119,7 +116,7 @@ function __fish_print_packages
|
|||
end
|
||||
|
||||
# Remove package version information from output and pipe into cache file
|
||||
/usr/share/yum-cli/completion-helper.py list all -d 0 -C | sed "s/\..*/\t$package/" >$cache_file &
|
||||
/usr/share/yum-cli/completion-helper.py list all -d 0 -C | sed "s/\..*/\tPackage/" >$cache_file &
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -141,7 +138,7 @@ function __fish_print_packages
|
|||
end
|
||||
|
||||
# Remove package version information from output and pipe into cache file
|
||||
rpm -qa | sed -e 's/-[^-]*-[^-]*$/\t'$package'/' >$cache_file &
|
||||
rpm -qa | sed -e 's/-[^-]*-[^-]*$/\t'Package'/' >$cache_file &
|
||||
return
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user