Add the ability to sign and verify files.
[tinc] / bash_completion.d / tinc
index f486f87..dec09f8 100644 (file)
@@ -4,8 +4,8 @@ _tinc() {
        cur="${COMP_WORDS[COMP_CWORD]}"
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        opts="-c -d -D -K -n -o -L -R -U --config --no-detach --debug --net --option --mlock --logfile --pidfile --chroot --user --help --version"
-       confvars="Address AddressFamily BindToAddress BindToInterface Broadcast Cipher ClampMSS Compression ConnectTo DecrementTTL Device DeviceType Digest DirectOnly ECDSAPrivateKeyFile ECDSAPublicKey ECDSAPublicKeyFile ExperimentalProtocol Forwarding GraphDumpFile Hostnames IffOneQueue IndirectData Interface KeyExpire LocalDiscovery MACExpire MACLength MaxOutputBufferSize MaxTimeout Mode Name PMTU PMTUDiscovery PingInterval PingTimeout Port PriorityInheritance PrivateKeyFile ProcessPriority Proxy PublicKeyFile ReplayWindow StrictSubnets Subnet TCPOnly TunnelServer UDPRcvBuf UDPSndBuf VDEGroup VDEPort Weight"
-       commands="config connect debug disconnect dump edit export export-all generate-ecdsa-keys generate-keys generate-rsa-keys help import info init log pcap pid purge reload restart retry start stop top version"
+       confvars="Address AddressFamily BindToAddress BindToInterface Broadcast BroadcastSubnet Cipher ClampMSS Compression ConnectTo DecrementTTL Device DeviceStandby DeviceType Digest DirectOnly Ed25519PrivateKeyFile Ed25519PublicKey Ed25519PublicKeyFile ExperimentalProtocol Forwarding GraphDumpFile Hostnames IffOneQueue IndirectData Interface KeyExpire ListenAddress LocalDiscovery MACExpire MACLength MaxOutputBufferSize MaxTimeout Mode MTUInfoInterval Name PMTU PMTUDiscovery PingInterval PingTimeout Port PriorityInheritance PrivateKeyFile ProcessPriority Proxy PublicKeyFile ReplayWindow StrictSubnets Subnet TCPOnly TunnelServer UDPDiscovery UDPDiscoveryKeepaliveInterval UDPDiscoveryInterval UDPDiscoveryTimeout UDPInfoInterval UDPRcvBuf UDPSndBuf UPnP UPnPDiscoverWait UPnPRefreshPeriod VDEGroup VDEPort Weight"
+       commands="add connect debug del disconnect dump edit export export-all generate-ed25519-keys generate-keys generate-rsa-keys get help import info init invite join list log network pcap pid purge reload restart retry set sign start stop top verify version"
 
        case ${prev} in
                -c|--config)
@@ -53,15 +53,24 @@ _tinc() {
        fi
        COMPREPLY=( $(compgen -W "${commands}" -- ${cur}) )
        case $prev in
-               config)
-               COMPREPLY=( $(compgen -W "get set add del ${confvars}" -- ${cur}) )
-               return 0
-               ;;
                get|set|add|del)
                COMPREPLY=( $(compgen -W "${confvars}" -- ${cur}) )
+               return 0
                ;;
-               dump)
-               COMPREPLY=( $(compgen -W "nodes edges subnets connections graph" -- ${cur}) )
+               dump|list|reachable)
+               COMPREPLY=( $(compgen -W "reachable nodes edges subnets connections graph invitations" -- ${cur}) )
+               return 0
+               ;;
+               network)
+               nets=""
+               pushd /etc/tinc >/dev/null 2>/dev/null
+               for dir in *; do
+                       if [[ -f "$dir/tinc.conf" ]]; then
+                               nets="$nets $dir"
+                       fi
+               done
+               popd >/dev/null 2>/dev/null
+               COMPREPLY=( $(compgen -W "${nets}" -- ${cur}) )
                return 0
                ;;
        esac
@@ -80,4 +89,4 @@ _tincctl() {
 }
 
 complete -F _tincd tincd
-complete -F _tincctl tincctl
+complete -F _tincctl tinc