From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14427 invoked by alias); 17 Aug 2017 15:54:13 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41561 Received: (qmail 3234 invoked by uid 1010); 17 Aug 2017 15:54:13 -0000 X-Qmail-Scanner-Diagnostics: from nm5-vm5.bullet.mail.ir2.yahoo.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(212.82.96.112):SA:0(-1.9/5.0):. Processed in 2.062876 secs); 17 Aug 2017 15:54:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: okiddle@yahoo.co.uk X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1502984917; bh=kgk0/bs3pw9UkKIseOd9aWvRR7TYVGKEODYpzBNtKRQ=; h=From:To:Subject:Date:From:Subject; b=uN4xyYr8LFAa+ZaTcEXT3IQ8tWq6/hwe4L8SJBAFRnPCNtWs83jxof2PJ5mKGI3SM6k38768we/1VG4R+a8VJ7j0w9XuHkBw1Z393e6bNNnraHgtosa7ucsC2AWtUP5aR9w62Or1R3bh00y/8+4kMIAOV0Uei3Lumjt9L5J2x+2pf4MD/eUjSCqb4ugXz1s5F3h+o6DWptRmEc9rcfY531z+DUR4EKxoj8+2A2DKWQFgCYLKBREgkIMMEer5oyZBpeq3pfb0U4flDvnBqXjGGBoTgzS1AX3Kgx6ibRLtr2tb6B7HhWQfbDKyYrxs5rxTQMieWoax0S0boKHnsTf59A== X-Yahoo-Newman-Id: 227238.75154.bm@smtp143.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: _zW5ozUVM1mXy7AxGJbhMD2DSkrmedt9vvnffBJX1gVIY7l Z4yD1HKNIRw3fbhfSn1u2QoBdUMJQcCRiJ79lTP92.uBvgKsquUod4sGWhQo f0KAR6NiD1ou8uGCitZYQ2_u_aUW8gCAUDC0Q8MONo5RYcEJ2JxWvvjl.Zqr mZa__YKtUdbVPt7h1zMNhKjlBBxALyuZIF26GOVL9dapps2Lyc3FeTT53Q9b z6ZJnTUKkrZVSfVgTl4Y7VtFF3QkB7_N3X2gCZvjUkCh2gesuF.hYXu_ZBxt kZLCgQ.Fzqt32ILgA0Eph.micgEw.UJLePPqK8UKebE6K93zwv820MFguj9Y IeGoJ.L8wqgPnH45_bZlVfs8PMj0qsP93CS6kkcSW_CDbwQoftGJRALMLL0_ e_DJu4us6sY0k72.I37lCUoRmQ84Ldc5CB8KtGGD04kTa8h3P9jl7I4Dci_2 KejeWA.fhQvOAZC_qrTDulOLibE9CT2axLNwr5MuXunzYJA-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- From: Oliver Kiddle To: Zsh workers Subject: PATCH: dhclient completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26472.1502984915.1@thecus.kiddle.eu> Date: Thu, 17 Aug 2017 17:48:35 +0200 Message-ID: <26473.1502984915@thecus.kiddle.eu> This handles free/openbsd and brings options up-to-date for the ISC implementation used on NetBSD and some linuxes. I've just noticed that the chsh patch I just sent in the last e-mail was reversed so sorry about that. Oliver diff --git a/Completion/Unix/Command/_dhclient b/Completion/Unix/Command/_dhclient index dafe299d9..10cb551e0 100644 --- a/Completion/Unix/Command/_dhclient +++ b/Completion/Unix/Command/_dhclient @@ -2,27 +2,69 @@ local args -if _pick_variant three=V3 two --help; then - args=( - '-q[quiet]' - '-1[only try once to get a lease]' - '-r[release the current lease]' - '-lf[lease file]:lease file:_files' - '-pf[pid file]:pid file:_files' - '-cf[config file]:config file:_files' - '-sf[script file]:script file:_files' - '-e[env vars to pass to child processes]:env var key value pairs:' - '-s[transmit to specific target instead of broadcast]:server:_hosts' - '-g[force giaddr field]:relay:_hosts' - '-n[do not configure any interfaces]' - '-nw[daemonize immediately rather than wait for IP acquisition]' - '-w[do not exit if there are no interfaces found to configure]' - ) -else - args=( '-e[exit if configuration failed after a certain time]' ) -fi +case $OSTYPE in + (open|free)bsd*) + args+=( + '-c+[specify configuration file]:file:_files' + '-l+[specify leases file]:file:_files' + '-u[reject leases with unknown options]' + ) + ;| + freebsd*) + args+=( + '(-d)-b[immediately move to the background]' + '-p+[specify PID file]:file:_files' + ) + ;; + openbsd*) + args+=( + '-i+[ignore values provided by leases for specified options]:options' + '-L+[specify file to write option data too]:file:_files' + ) + ;; + *) # ISC implementation, used on Linux and NetBSD + args=( + '!(-6 -S -T -P -D -N)-4' + '(-4 -s)-6[use the DHCPv6 protocol]' + '-1[only try once to get a lease]' + '(-d)-nw[daemonize immediately rather than wait for IP acquisition]' + "-m[don't require responding ethernet address of dhcp server to match expectation]" + '-v[verbose log messages]' + "-w[don't exit if there are no interfaces found to configure]" + "-n[don't configure any interfaces]" + '-e[specify env vars to pass to child processes]:env var key value pairs' + '(-x)-r[release the current lease]' + '(-r)-x[stop the running DHCP client without releaseing current lease]' + '-p[specify port to transmit to / listen on]:port:_ports' + '(-6)-s[transmit to specific target instead of broadcast]:server:_hosts' + '-g[force giaddr field]:relay:_hosts' + '-i[use a DUID with DHCPv4 clients]' + '-I[use the standard DDNS scheme]' + '--version[display version number]' + '(-4)-S[use Information-request to get only stateless configuration]' + '(-4)*-T[ask for IPv6 temporary addresses]' + '(-4)-P[enable IPv6 prefix delegation]' + '-D[specify DUID selection method]:DUID:((LL\:link-layer LLT\:link-layer\ plus\ timestamp))' + '(-4)-N[restore normal address query for IPv6]' + '-lf[lease file]:lease file:_files' + '(--no-pid)-pf[pid file]:pid file:_files' + '(-pf)--no-pid[disable writing pid files]' + '-cf[config file]:config file:_files' + '-sf[script file]:script file:_files' + '-4o6[DHCPv4 over DHCPv6 protocol]:port' + "-nc[don't drop capabilities]" + '-B[set the BOOTP broadcast flag in request packets]' + '-C[specify dhcp-client-identifier option]:option' + '(-F)-H[specify host-name option]:host name:_hosts' + '(-H)-F[specify fully qualified hostname option]:host name:_hosts' + '-V[specify vendor-class-identifier option]:option' + '--request-options[specify list of options the client is to request from the server]:options' + '--timeout[specify time after which dhclient will decide that no DHCP servers can be contacted]:timeout' + ) + ;; +esac -_arguments $args \ - '-p[port to transmit to / listen on]:_ports' \ - '-d[force to run in foreground]' \ +_arguments -s -S -A "-*" $args \ + '-q[quiet]' \ + '(-b -nw)-d[remain as a foreground process]' \ ':interface:_net_interfaces'