2022-07-05 16:41:23 -07:00
|
|
|
#compdef jc
|
|
|
|
|
|
|
|
_jc() {
|
|
|
|
local -a jc_commands jc_commands_describe \
|
|
|
|
jc_parsers jc_parsers_describe \
|
|
|
|
jc_options jc_options_describe \
|
|
|
|
jc_about_options jc_about_options_describe \
|
|
|
|
jc_about_mod_options jc_about_mod_options_describe \
|
|
|
|
jc_help_options jc_help_options_describe \
|
|
|
|
jc_special_options jc_special_options_describe
|
|
|
|
|
2023-11-28 11:23:47 -08:00
|
|
|
jc_commands=(acpi airport arp blkid bluetoothctl cbt certbot chage cksum crontab date debconf-show df dig dmidecode dpkg du env file findmnt finger free git gpg hciconfig host id ifconfig iostat ip iptables iw iwconfig jobs last lastb ls lsattr lsb_release lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat netstat nmcli nsd-control ntpq os-prober pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum swapon sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 tune2fs udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc who xrandr zipinfo zpool)
|
2022-07-05 16:41:23 -07:00
|
|
|
jc_commands_describe=(
|
|
|
|
'acpi:run "acpi" command with magic syntax.'
|
|
|
|
'airport:run "airport" command with magic syntax.'
|
|
|
|
'arp:run "arp" command with magic syntax.'
|
|
|
|
'blkid:run "blkid" command with magic syntax.'
|
2023-04-16 11:46:21 -07:00
|
|
|
'bluetoothctl:run "bluetoothctl" command with magic syntax.'
|
2022-12-13 12:13:27 -08:00
|
|
|
'cbt:run "cbt" command with magic syntax.'
|
2023-04-29 16:34:23 -07:00
|
|
|
'certbot:run "certbot" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'chage:run "chage" command with magic syntax.'
|
|
|
|
'cksum:run "cksum" command with magic syntax.'
|
|
|
|
'crontab:run "crontab" command with magic syntax.'
|
|
|
|
'date:run "date" command with magic syntax.'
|
2023-11-23 14:52:06 -08:00
|
|
|
'debconf-show:run "debconf-show" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'df:run "df" command with magic syntax.'
|
|
|
|
'dig:run "dig" command with magic syntax.'
|
|
|
|
'dmidecode:run "dmidecode" command with magic syntax.'
|
|
|
|
'dpkg:run "dpkg" command with magic syntax.'
|
|
|
|
'du:run "du" command with magic syntax.'
|
|
|
|
'env:run "env" command with magic syntax.'
|
|
|
|
'file:run "file" command with magic syntax.'
|
2022-11-01 13:15:31 -07:00
|
|
|
'findmnt:run "findmnt" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'finger:run "finger" command with magic syntax.'
|
|
|
|
'free:run "free" command with magic syntax.'
|
|
|
|
'git:run "git" command with magic syntax.'
|
|
|
|
'gpg:run "gpg" command with magic syntax.'
|
|
|
|
'hciconfig:run "hciconfig" command with magic syntax.'
|
2023-09-30 15:32:27 -07:00
|
|
|
'host:run "host" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'id:run "id" command with magic syntax.'
|
|
|
|
'ifconfig:run "ifconfig" command with magic syntax.'
|
|
|
|
'iostat:run "iostat" command with magic syntax.'
|
2023-07-30 10:08:39 -07:00
|
|
|
'ip:run "ip" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'iptables:run "iptables" command with magic syntax.'
|
|
|
|
'iw:run "iw" command with magic syntax.'
|
2022-12-23 09:12:09 -08:00
|
|
|
'iwconfig:run "iwconfig" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'jobs:run "jobs" command with magic syntax.'
|
|
|
|
'last:run "last" command with magic syntax.'
|
|
|
|
'lastb:run "lastb" command with magic syntax.'
|
|
|
|
'ls:run "ls" command with magic syntax.'
|
2023-06-22 01:48:23 +03:00
|
|
|
'lsattr:run "lsattr" command with magic syntax.'
|
2023-10-01 18:13:27 -07:00
|
|
|
'lsb_release:run "lsb_release" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'lsblk:run "lsblk" command with magic syntax.'
|
|
|
|
'lsmod:run "lsmod" command with magic syntax.'
|
|
|
|
'lsof:run "lsof" command with magic syntax.'
|
2022-10-08 09:04:21 -07:00
|
|
|
'lspci:run "lspci" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'lsusb:run "lsusb" command with magic syntax.'
|
|
|
|
'md5:run "md5" command with magic syntax.'
|
|
|
|
'md5sum:run "md5sum" command with magic syntax.'
|
2022-08-12 10:16:15 -07:00
|
|
|
'mdadm:run "mdadm" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'mount:run "mount" command with magic syntax.'
|
|
|
|
'mpstat:run "mpstat" command with magic syntax.'
|
|
|
|
'netstat:run "netstat" command with magic syntax.'
|
|
|
|
'nmcli:run "nmcli" command with magic syntax.'
|
2023-09-30 15:45:29 -07:00
|
|
|
'nsd-control:run "nsd-control" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'ntpq:run "ntpq" command with magic syntax.'
|
2022-11-07 13:23:55 -08:00
|
|
|
'os-prober:run "os-prober" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'pidstat:run "pidstat" command with magic syntax.'
|
|
|
|
'ping:run "ping" command with magic syntax.'
|
|
|
|
'ping6:run "ping6" command with magic syntax.'
|
|
|
|
'pip:run "pip" command with magic syntax.'
|
|
|
|
'pip3:run "pip3" command with magic syntax.'
|
|
|
|
'postconf:run "postconf" command with magic syntax.'
|
|
|
|
'printenv:run "printenv" command with magic syntax.'
|
|
|
|
'ps:run "ps" command with magic syntax.'
|
|
|
|
'route:run "route" command with magic syntax.'
|
|
|
|
'rpm:run "rpm" command with magic syntax.'
|
|
|
|
'rsync:run "rsync" command with magic syntax.'
|
|
|
|
'sfdisk:run "sfdisk" command with magic syntax.'
|
|
|
|
'sha1sum:run "sha1sum" command with magic syntax.'
|
|
|
|
'sha224sum:run "sha224sum" command with magic syntax.'
|
|
|
|
'sha256sum:run "sha256sum" command with magic syntax.'
|
|
|
|
'sha384sum:run "sha384sum" command with magic syntax.'
|
|
|
|
'sha512sum:run "sha512sum" command with magic syntax.'
|
|
|
|
'shasum:run "shasum" command with magic syntax.'
|
|
|
|
'ss:run "ss" command with magic syntax.'
|
2023-01-22 10:37:27 -08:00
|
|
|
'ssh:run "ssh" command with magic syntax.'
|
2022-10-31 09:22:39 -07:00
|
|
|
'sshd:run "sshd" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'stat:run "stat" command with magic syntax.'
|
|
|
|
'sum:run "sum" command with magic syntax.'
|
2023-11-28 11:23:47 -08:00
|
|
|
'swapon:run "swapon" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'sysctl:run "sysctl" command with magic syntax.'
|
|
|
|
'systemctl:run "systemctl" command with magic syntax.'
|
|
|
|
'systeminfo:run "systeminfo" command with magic syntax.'
|
|
|
|
'timedatectl:run "timedatectl" command with magic syntax.'
|
|
|
|
'top:run "top" command with magic syntax.'
|
|
|
|
'tracepath:run "tracepath" command with magic syntax.'
|
|
|
|
'tracepath6:run "tracepath6" command with magic syntax.'
|
|
|
|
'traceroute:run "traceroute" command with magic syntax.'
|
|
|
|
'traceroute6:run "traceroute6" command with magic syntax.'
|
2023-11-23 11:49:04 -08:00
|
|
|
'tune2fs:run "tune2fs" command with magic syntax.'
|
2022-10-08 09:04:21 -07:00
|
|
|
'udevadm:run "udevadm" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'ufw:run "ufw" command with magic syntax.'
|
|
|
|
'uname:run "uname" command with magic syntax.'
|
|
|
|
'update-alternatives:run "update-alternatives" command with magic syntax.'
|
|
|
|
'upower:run "upower" command with magic syntax.'
|
|
|
|
'uptime:run "uptime" command with magic syntax.'
|
|
|
|
'vdir:run "vdir" command with magic syntax.'
|
2023-06-22 01:48:23 +03:00
|
|
|
'veracrypt:run "veracrypt" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'vmstat:run "vmstat" command with magic syntax.'
|
|
|
|
'w:run "w" command with magic syntax.'
|
|
|
|
'wc:run "wc" command with magic syntax.'
|
|
|
|
'who:run "who" command with magic syntax.'
|
|
|
|
'xrandr:run "xrandr" command with magic syntax.'
|
|
|
|
'zipinfo:run "zipinfo" command with magic syntax.'
|
2023-01-31 17:00:42 -08:00
|
|
|
'zpool:run "zpool" command with magic syntax.'
|
2022-07-05 16:41:23 -07:00
|
|
|
)
|
2023-12-16 12:55:29 -08:00
|
|
|
jc_parsers=(--acpi --airport --airport-s --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --email-address --env --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --passwd --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
2022-07-05 16:41:23 -07:00
|
|
|
jc_parsers_describe=(
|
|
|
|
'--acpi:`acpi` command parser'
|
|
|
|
'--airport:`airport -I` command parser'
|
|
|
|
'--airport-s:`airport -s` command parser'
|
|
|
|
'--arp:`arp` command parser'
|
|
|
|
'--asciitable:ASCII and Unicode table parser'
|
|
|
|
'--asciitable-m:multi-line ASCII and Unicode table parser'
|
|
|
|
'--blkid:`blkid` command parser'
|
2023-04-16 11:46:21 -07:00
|
|
|
'--bluetoothctl:`bluetoothctl` command parser'
|
2022-12-16 12:54:07 -08:00
|
|
|
'--cbt:`cbt` (Google Bigtable) command parser'
|
2022-08-12 10:16:15 -07:00
|
|
|
'--cef:CEF string parser'
|
2022-08-20 13:30:39 -07:00
|
|
|
'--cef-s:CEF string streaming parser'
|
2023-04-29 16:34:23 -07:00
|
|
|
'--certbot:`certbot` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--chage:`chage --list` command parser'
|
|
|
|
'--cksum:`cksum` and `sum` command parser'
|
2022-11-21 11:00:58 -08:00
|
|
|
'--clf:Common and Combined Log Format file parser'
|
2022-11-21 16:54:13 -08:00
|
|
|
'--clf-s:Common and Combined Log Format file streaming parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--crontab:`crontab` command and file parser'
|
|
|
|
'--crontab-u:`crontab` file parser with user support'
|
|
|
|
'--csv:CSV file parser'
|
|
|
|
'--csv-s:CSV file streaming parser'
|
|
|
|
'--date:`date` command parser'
|
2022-10-09 11:00:02 -07:00
|
|
|
'--datetime-iso:ISO 8601 Datetime string parser'
|
2023-11-23 14:52:06 -08:00
|
|
|
'--debconf-show:`debconf-show` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--df:`df` command parser'
|
|
|
|
'--dig:`dig` command parser'
|
|
|
|
'--dir:`dir` command parser'
|
|
|
|
'--dmidecode:`dmidecode` command parser'
|
|
|
|
'--dpkg-l:`dpkg -l` command parser'
|
|
|
|
'--du:`du` command parser'
|
2022-07-19 13:02:09 -07:00
|
|
|
'--email-address:Email Address string parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--env:`env` command parser'
|
|
|
|
'--file:`file` command parser'
|
2023-07-30 10:08:39 -07:00
|
|
|
'--find:`find` command parser'
|
2022-11-01 13:15:31 -07:00
|
|
|
'--findmnt:`findmnt` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--finger:`finger` command parser'
|
|
|
|
'--free:`free` command parser'
|
|
|
|
'--fstab:`/etc/fstab` file parser'
|
|
|
|
'--git-log:`git log` command parser'
|
|
|
|
'--git-log-s:`git log` command streaming parser'
|
2022-11-07 13:02:55 -08:00
|
|
|
'--git-ls-remote:`git ls-remote` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--gpg:`gpg --with-colons` command parser'
|
|
|
|
'--group:`/etc/group` file parser'
|
|
|
|
'--gshadow:`/etc/gshadow` file parser'
|
|
|
|
'--hash:`hash` command parser'
|
|
|
|
'--hashsum:hashsum command parser (`md5sum`, `shasum`, etc.)'
|
|
|
|
'--hciconfig:`hciconfig` command parser'
|
|
|
|
'--history:`history` command parser'
|
2023-09-30 15:32:27 -07:00
|
|
|
'--host:`host` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--hosts:`/etc/hosts` file parser'
|
|
|
|
'--id:`id` command parser'
|
|
|
|
'--ifconfig:`ifconfig` command parser'
|
|
|
|
'--ini:INI file parser'
|
2023-01-08 19:46:13 -08:00
|
|
|
'--ini-dup:INI with duplicate key file parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--iostat:`iostat` command parser'
|
|
|
|
'--iostat-s:`iostat` command streaming parser'
|
2022-07-28 09:03:49 -07:00
|
|
|
'--ip-address:IPv4 and IPv6 Address string parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--iptables:`iptables` command parser'
|
2023-07-30 10:08:39 -07:00
|
|
|
'--ip-route:`ip route` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--iw-scan:`iw dev [device] scan` command parser'
|
2022-12-23 09:12:09 -08:00
|
|
|
'--iwconfig:`iwconfig` command parser'
|
2022-08-15 13:51:48 -07:00
|
|
|
'--jar-manifest:Java MANIFEST.MF file parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--jobs:`jobs` command parser'
|
2022-07-19 15:24:38 -07:00
|
|
|
'--jwt:JWT string parser'
|
2022-12-27 14:01:03 -08:00
|
|
|
'--kv:Key/Value file and string parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--last:`last` and `lastb` command parser'
|
|
|
|
'--ls:`ls` command parser'
|
|
|
|
'--ls-s:`ls` command streaming parser'
|
2023-06-22 01:48:23 +03:00
|
|
|
'--lsattr:`lsattr` command parser'
|
2023-10-01 18:13:27 -07:00
|
|
|
'--lsb-release:`lsb_release` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--lsblk:`lsblk` command parser'
|
|
|
|
'--lsmod:`lsmod` command parser'
|
|
|
|
'--lsof:`lsof` command parser'
|
2022-10-08 09:04:21 -07:00
|
|
|
'--lspci:`lspci -mmv` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--lsusb:`lsusb` command parser'
|
2022-07-16 20:52:19 -07:00
|
|
|
'--m3u:M3U and M3U8 file parser'
|
2022-08-12 10:16:15 -07:00
|
|
|
'--mdadm:`mdadm` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--mount:`mount` command parser'
|
|
|
|
'--mpstat:`mpstat` command parser'
|
|
|
|
'--mpstat-s:`mpstat` command streaming parser'
|
|
|
|
'--netstat:`netstat` command parser'
|
|
|
|
'--nmcli:`nmcli` command parser'
|
2023-09-30 15:45:29 -07:00
|
|
|
'--nsd-control:`nsd-control` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--ntpq:`ntpq -p` command parser'
|
2022-12-13 17:31:05 -08:00
|
|
|
'--openvpn:openvpn-status.log file parser'
|
2022-11-07 13:23:55 -08:00
|
|
|
'--os-prober:`os-prober` command parser'
|
2023-10-01 17:42:00 -07:00
|
|
|
'--os-release:`/etc/os-release` file parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--passwd:`/etc/passwd` file parser'
|
2022-10-08 09:04:21 -07:00
|
|
|
'--pci-ids:`pci.ids` file parser'
|
2022-12-05 14:54:23 -08:00
|
|
|
'--pgpass:PostgreSQL password file parser'
|
2022-09-22 14:35:53 -07:00
|
|
|
'--pidstat:`pidstat -H` command parser'
|
2022-09-22 14:41:40 -07:00
|
|
|
'--pidstat-s:`pidstat -H` command streaming parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--ping:`ping` and `ping6` command parser'
|
|
|
|
'--ping-s:`ping` and `ping6` command streaming parser'
|
|
|
|
'--pip-list:`pip list` command parser'
|
|
|
|
'--pip-show:`pip show` command parser'
|
2023-12-10 10:49:05 -08:00
|
|
|
'--pkg-index-apk:Alpine Linux Package Index file parser'
|
2023-12-09 10:17:48 -08:00
|
|
|
'--pkg-index-deb:Debian Package Index file parser'
|
2022-07-31 16:14:04 -07:00
|
|
|
'--plist:PLIST file parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--postconf:`postconf -M` command parser'
|
2022-09-06 10:07:19 -07:00
|
|
|
'--proc:`/proc/` file parser'
|
2022-09-26 15:46:59 -07:00
|
|
|
'--proc-buddyinfo:`/proc/buddyinfo` file parser'
|
2023-12-16 12:55:29 -08:00
|
|
|
'--proc-cmdline:`/proc/cmdline` file parser'
|
2022-09-26 15:46:59 -07:00
|
|
|
'--proc-consoles:`/proc/consoles` file parser'
|
|
|
|
'--proc-cpuinfo:`/proc/cpuinfo` file parser'
|
|
|
|
'--proc-crypto:`/proc/crypto` file parser'
|
|
|
|
'--proc-devices:`/proc/devices` file parser'
|
|
|
|
'--proc-diskstats:`/proc/diskstats` file parser'
|
|
|
|
'--proc-filesystems:`/proc/filesystems` file parser'
|
|
|
|
'--proc-interrupts:`/proc/interrupts` file parser'
|
|
|
|
'--proc-iomem:`/proc/iomem` file parser'
|
|
|
|
'--proc-ioports:`/proc/ioports` file parser'
|
|
|
|
'--proc-loadavg:`/proc/loadavg` file parser'
|
|
|
|
'--proc-locks:`/proc/locks` file parser'
|
|
|
|
'--proc-meminfo:`/proc/meminfo` file parser'
|
|
|
|
'--proc-modules:`/proc/modules` file parser'
|
|
|
|
'--proc-mtrr:`/proc/mtrr` file parser'
|
|
|
|
'--proc-pagetypeinfo:`/proc/pagetypeinfo` file parser'
|
|
|
|
'--proc-partitions:`/proc/partitions` file parser'
|
|
|
|
'--proc-slabinfo:`/proc/slabinfo` file parser'
|
|
|
|
'--proc-softirqs:`/proc/softirqs` file parser'
|
|
|
|
'--proc-stat:`/proc/stat` file parser'
|
|
|
|
'--proc-swaps:`/proc/swaps` file parser'
|
|
|
|
'--proc-uptime:`/proc/uptime` file parser'
|
|
|
|
'--proc-version:`/proc/version` file parser'
|
|
|
|
'--proc-vmallocinfo:`/proc/vmallocinfo` file parser'
|
|
|
|
'--proc-vmstat:`/proc/vmstat` file parser'
|
|
|
|
'--proc-zoneinfo:`/proc/zoneinfo` file parser'
|
|
|
|
'--proc-driver-rtc:`/proc/driver/rtc` file parser'
|
|
|
|
'--proc-net-arp:`/proc/net/arp` file parser'
|
|
|
|
'--proc-net-dev:`/proc/net/dev` file parser'
|
|
|
|
'--proc-net-dev-mcast:`/proc/net/dev_mcast` file parser'
|
|
|
|
'--proc-net-if-inet6:`/proc/net/if_inet6` file parser'
|
|
|
|
'--proc-net-igmp:`/proc/net/igmp` file parser'
|
|
|
|
'--proc-net-igmp6:`/proc/net/igmp6` file parser'
|
|
|
|
'--proc-net-ipv6-route:`/proc/net/ipv6_route` file parser'
|
|
|
|
'--proc-net-netlink:`/proc/net/netlink` file parser'
|
|
|
|
'--proc-net-netstat:`/proc/net/netstat` file parser'
|
|
|
|
'--proc-net-packet:`/proc/net/packet` file parser'
|
|
|
|
'--proc-net-protocols:`/proc/net/protocols` file parser'
|
|
|
|
'--proc-net-route:`/proc/net/route` file parser'
|
2023-07-30 10:08:39 -07:00
|
|
|
'--proc-net-tcp:`/proc/net/tcp` and `/proc/net/tcp6` file parser'
|
2022-09-26 15:46:59 -07:00
|
|
|
'--proc-net-unix:`/proc/net/unix` file parser'
|
|
|
|
'--proc-pid-fdinfo:`/proc/<pid>/fdinfo/<fd>` file parser'
|
|
|
|
'--proc-pid-io:`/proc/<pid>/io` file parser'
|
|
|
|
'--proc-pid-maps:`/proc/<pid>/maps` file parser'
|
|
|
|
'--proc-pid-mountinfo:`/proc/<pid>/mountinfo` file parser'
|
|
|
|
'--proc-pid-numa-maps:`/proc/<pid>/numa_maps` file parser'
|
|
|
|
'--proc-pid-smaps:`/proc/<pid>/smaps` file parser'
|
|
|
|
'--proc-pid-stat:`/proc/<pid>/stat` file parser'
|
|
|
|
'--proc-pid-statm:`/proc/<pid>/statm` file parser'
|
|
|
|
'--proc-pid-status:`/proc/<pid>/status` file parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--ps:`ps` command parser'
|
2023-07-30 10:08:39 -07:00
|
|
|
'--resolve-conf:`/etc/resolve.conf` file parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--route:`route` command parser'
|
|
|
|
'--rpm-qi:`rpm -qi` command parser'
|
|
|
|
'--rsync:`rsync` command parser'
|
|
|
|
'--rsync-s:`rsync` command streaming parser'
|
2022-11-04 16:03:39 -07:00
|
|
|
'--semver:Semantic Version string parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--sfdisk:`sfdisk` command parser'
|
|
|
|
'--shadow:`/etc/shadow` file parser'
|
2023-06-22 01:48:23 +03:00
|
|
|
'--srt:SRT file parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--ss:`ss` command parser'
|
2023-01-22 12:44:16 -08:00
|
|
|
'--ssh-conf:`ssh` config file and `ssh -G` command parser'
|
|
|
|
'--sshd-conf:`sshd` config file and `sshd -T` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--stat:`stat` command parser'
|
|
|
|
'--stat-s:`stat` command streaming parser'
|
2023-11-28 11:23:47 -08:00
|
|
|
'--swapon:`swapon` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--sysctl:`sysctl` command parser'
|
2022-08-12 10:16:15 -07:00
|
|
|
'--syslog:Syslog RFC 5424 string parser'
|
2022-08-16 16:33:50 -07:00
|
|
|
'--syslog-s:Syslog RFC 5424 string streaming parser'
|
|
|
|
'--syslog-bsd:Syslog RFC 3164 string parser'
|
|
|
|
'--syslog-bsd-s:Syslog RFC 3164 string streaming parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--systemctl:`systemctl` command parser'
|
|
|
|
'--systemctl-lj:`systemctl list-jobs` command parser'
|
|
|
|
'--systemctl-ls:`systemctl list-sockets` command parser'
|
|
|
|
'--systemctl-luf:`systemctl list-unit-files` command parser'
|
|
|
|
'--systeminfo:`systeminfo` command parser'
|
|
|
|
'--time:`/usr/bin/time` command parser'
|
|
|
|
'--timedatectl:`timedatectl status` command parser'
|
2022-08-04 11:43:49 -07:00
|
|
|
'--timestamp:Unix Epoch Timestamp string parser'
|
2023-01-05 11:27:49 -08:00
|
|
|
'--toml:TOML file parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--top:`top -b` command parser'
|
|
|
|
'--top-s:`top -b` command streaming parser'
|
|
|
|
'--tracepath:`tracepath` and `tracepath6` command parser'
|
|
|
|
'--traceroute:`traceroute` and `traceroute6` command parser'
|
2023-11-23 11:49:04 -08:00
|
|
|
'--tune2fs:`tune2fs -l` command parser'
|
2022-10-08 09:04:21 -07:00
|
|
|
'--udevadm:`udevadm info` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--ufw:`ufw status` command parser'
|
|
|
|
'--ufw-appinfo:`ufw app info [application]` command parser'
|
|
|
|
'--uname:`uname -a` command parser'
|
|
|
|
'--update-alt-gs:`update-alternatives --get-selections` command parser'
|
|
|
|
'--update-alt-q:`update-alternatives --query` command parser'
|
|
|
|
'--upower:`upower` command parser'
|
|
|
|
'--uptime:`uptime` command parser'
|
2022-07-19 13:02:09 -07:00
|
|
|
'--url:URL string parser'
|
2023-01-27 11:41:21 -08:00
|
|
|
'--ver:Version string parser'
|
2023-06-22 01:48:23 +03:00
|
|
|
'--veracrypt:`veracrypt` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--vmstat:`vmstat` command parser'
|
|
|
|
'--vmstat-s:`vmstat` command streaming parser'
|
|
|
|
'--w:`w` command parser'
|
|
|
|
'--wc:`wc` command parser'
|
|
|
|
'--who:`who` command parser'
|
|
|
|
'--x509-cert:X.509 PEM and DER certificate file parser'
|
2023-06-22 01:48:23 +03:00
|
|
|
'--x509-csr:X.509 PEM and DER certificate request file parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--xml:XML file parser'
|
|
|
|
'--xrandr:`xrandr` command parser'
|
|
|
|
'--yaml:YAML file parser'
|
|
|
|
'--zipinfo:`zipinfo` command parser'
|
2023-01-31 17:00:42 -08:00
|
|
|
'--zpool-iostat:`zpool iostat` command parser'
|
2023-02-05 09:49:32 -08:00
|
|
|
'--zpool-status:`zpool status` command parser'
|
2022-07-05 16:41:23 -07:00
|
|
|
)
|
2022-08-21 12:38:55 -07:00
|
|
|
jc_options=(--force-color -C --debug -d --monochrome -m --meta-out -M --pretty -p --quiet -q --raw -r --unbuffer -u --yaml-out -y)
|
2022-07-05 16:41:23 -07:00
|
|
|
jc_options_describe=(
|
2022-12-27 15:59:43 -08:00
|
|
|
'--force-color:force color output (overrides -m)'
|
|
|
|
'-C:force color output (overrides -m)'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--debug:debug (double for verbose debug)'
|
|
|
|
'-d:debug (double for verbose debug)'
|
|
|
|
'--monochrome:monochrome output'
|
|
|
|
'-m:monochrome output'
|
2022-08-21 12:38:55 -07:00
|
|
|
'--meta-out:add metadata to output including timestamp, etc.'
|
|
|
|
'-M:add metadata to output including timestamp, etc.'
|
2022-07-05 16:41:23 -07:00
|
|
|
'--pretty:pretty print output'
|
|
|
|
'-p:pretty print output'
|
|
|
|
'--quiet:suppress warnings (double to ignore streaming errors)'
|
|
|
|
'-q:suppress warnings (double to ignore streaming errors)'
|
|
|
|
'--raw:raw output'
|
|
|
|
'-r:raw output'
|
|
|
|
'--unbuffer:unbuffer output'
|
|
|
|
'-u:unbuffer output'
|
|
|
|
'--yaml-out:YAML output'
|
|
|
|
'-y:YAML output'
|
|
|
|
)
|
|
|
|
jc_about_options=(--about -a)
|
|
|
|
jc_about_options_describe=(
|
|
|
|
'--about:about jc'
|
|
|
|
'-a:about jc'
|
|
|
|
)
|
|
|
|
jc_about_mod_options=(--pretty -p --yaml-out -y --monochrome -m --force-color -C)
|
|
|
|
jc_about_mod_options_describe=(
|
|
|
|
'--pretty:pretty print output'
|
|
|
|
'-p:pretty print output'
|
|
|
|
'--yaml-out:YAML output'
|
|
|
|
'-y:YAML output'
|
|
|
|
'--monochrome:monochrome output'
|
|
|
|
'-m:monochrome output'
|
2022-12-27 15:59:43 -08:00
|
|
|
'--force-color:force color output (overrides -m)'
|
|
|
|
'-C:force color output (overrides -m)'
|
2022-07-05 16:41:23 -07:00
|
|
|
)
|
|
|
|
jc_help_options=(--help -h)
|
|
|
|
jc_help_options_describe=(
|
|
|
|
'--help:help (--help --parser_name for parser documentation)'
|
|
|
|
'-h:help (--help --parser_name for parser documentation)'
|
|
|
|
)
|
|
|
|
jc_special_options=(--version -v --bash-comp -B --zsh-comp -Z)
|
|
|
|
jc_special_options_describe=(
|
|
|
|
'--version:version info'
|
|
|
|
'-v:version info'
|
|
|
|
'--bash-comp:gen Bash completion: jc -B > /etc/bash_completion.d/jc'
|
|
|
|
'-B:gen Bash completion: jc -B > /etc/bash_completion.d/jc'
|
|
|
|
'--zsh-comp:gen Zsh completion: jc -Z > "${fpath[1]}/_jc"'
|
|
|
|
'-Z:gen Zsh completion: jc -Z > "${fpath[1]}/_jc"'
|
|
|
|
)
|
|
|
|
|
|
|
|
# if jc_about_options are found anywhere in the line, then only complete from jc_about_mod_options
|
|
|
|
for i in ${words:0:-1}; do
|
|
|
|
if (( $jc_about_options[(Ie)${i}] )); then
|
|
|
|
_describe 'commands' jc_about_mod_options_describe
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# if jc_help_options and a parser are found anywhere in the line, then no more completions
|
|
|
|
if
|
|
|
|
(
|
|
|
|
for i in ${words:0:-1}; do
|
|
|
|
if (( $jc_help_options[(Ie)${i}] )); then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
return 1
|
|
|
|
) && (
|
|
|
|
for i in ${words:0:-1}; do
|
|
|
|
if (( $jc_parsers[(Ie)${i}] )); then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
return 1
|
|
|
|
); then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# if jc_help_options are found anywhere in the line, then only complete with parsers
|
|
|
|
for i in ${words:0:-1}; do
|
|
|
|
if (( $jc_help_options[(Ie)${i}] )); then
|
|
|
|
_describe 'commands' jc_parsers_describe
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# if special options are found anywhere in the line, then no more completions
|
|
|
|
for i in ${words:0:-1}; do
|
|
|
|
if (( $jc_special_options[(Ie)${i}] )); then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# if magic command is found anywhere in the line, use called command's autocompletion
|
|
|
|
for i in ${words:0:-1}; do
|
|
|
|
if (( $jc_commands[(Ie)${i}] )); then
|
|
|
|
# hack to remove options between jc and the magic command
|
|
|
|
shift $(( ${#words} - 2 )) words
|
|
|
|
words[1,0]=(jc)
|
|
|
|
CURRENT=${#words}
|
|
|
|
|
|
|
|
# run the magic command's completions
|
|
|
|
_arguments '*::arguments:_normal'
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2022-09-26 16:59:55 -07:00
|
|
|
# if "/pr[oc]" (magic for Procfile parsers) is in the current word, complete with files/directories in the path
|
|
|
|
if [[ "${words[-1]}" =~ "/pr" ]]; then
|
2022-09-26 15:46:59 -07:00
|
|
|
# run files completion
|
|
|
|
_files
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
2022-07-05 16:41:23 -07:00
|
|
|
# if a parser arg is found anywhere in the line, only show options and help options
|
|
|
|
for i in ${words:0:-1}; do
|
|
|
|
if (( $jc_parsers[(Ie)${i}] )); then
|
|
|
|
_describe 'commands' jc_options_describe -- jc_help_options_describe
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# default completion
|
|
|
|
_describe 'commands' jc_options_describe -- jc_about_options_describe -- jc_help_options_describe -- jc_special_options_describe -- jc_parsers_describe -- jc_commands_describe
|
|
|
|
}
|
|
|
|
|
|
|
|
_jc
|
|
|
|
|