From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27493 invoked by alias); 15 Sep 2017 15:05: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: 41710 Received: (qmail 28089 invoked by uid 1010); 15 Sep 2017 15:05:13 -0000 X-Qmail-Scanner-Diagnostics: from sonic304-22.consmr.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(77.238.179.147):SA:0(-2.7/5.0):. Processed in 1.085358 secs); 15 Sep 2017 15:05: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=-2.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, LONGWORDS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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=1505487906; bh=5g7p+LZLdoavEeXX6DhtinejnbrIXsnNu7ULsdTX3dY=; h=From:To:Subject:Date:From:Subject; b=fzY4fmzIfSirHFeQOomXJGjTyDuVIkQqXYGh1zZhKZcM2ccWukP+ZVFEiy065DCcDNr78P3kMMfPfKYwbZUSl5I2M5Iaxx2FAJ0MhKtGoTHdPzaDREmes1kmBQT7tL1dP3tncRGYW3nfTIf8+SOormza/802zoBvpZuwrsN/igiNYhlzH7H8wcYUyrTRoa6jAzWLgl/XOiwim7gIUuOCfE6vGqqXpxND2HTi9K+Jvz+tsA2pcu/QHiVPdaZOXDmeLq/4d1P1AxcpUWQD/BGGHmiqaLiixCJKfBWNv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c5y2sEVcK87.ZSmSVjtsepKWxvyki1mDebdF.oikBJcz5MRu_g7al_rCH X8ZbXnDX1KRSYSB2qY3C8GrGondYIJCOpPCExG1AkgoUmsw-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- From: Oliver Kiddle To: Zsh workers Subject: PATCH: smartctl completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5608.1505486094.1@thecus.kiddle.eu> Date: Fri, 15 Sep 2017 16:34:54 +0200 Message-ID: <5609.1505486094@thecus.kiddle.eu> This adds a new completion definition for smartctl. Oliver diff --git a/Completion/Unix/Command/_smartmontools b/Completion/Unix/Command/_smartmontools new file mode 100644 index 000000000..c60322ee0 --- /dev/null +++ b/Completion/Unix/Command/_smartmontools @@ -0,0 +1,61 @@ +#compdef smartctl + +local context state state_descr line + +_arguments -s -S \ + '(H -i --info)'{-i,--info}'[show identity information for device]' \ + '(H)--identify=-[show words and bits from indentification data]: : _values -S "" "words and bits" + "(n v)b[print all bits]" + "w[print all words]" + "(b v)n[suppress printing bits]" + "(b n)v[print all bits from valid words]"' \ + '(H)*'{-g+,--get=}'[get device setting]:setting:(all aam apm lookahead security wcache rcache wcreorder)' \ + '(H -a --all -x --xall -H --health -i --info -c --capabilities -A --attributes --scan --scan-open)'{-a,--all}'[show all SMART information for device]' \ + '(H -x --xall -a --all -H --health -i --info -c --capabilities -A --attributes --scan --scan-open)'{-x,--xall}'[show all information for device]' \ + '(H 1 --scan-open --identify -x --xall -a --all -H --health -i --info -c --capabilities -A --attributes)--scan[scan for devices]' \ + '(H 1 --scan --identify -x --xall -a --all -H --health -i --info -c --capabilities -A --attributes)--scan-open[scan for devices and try to open each device]' \ + '(H -q --quietmode)'{-q+,--quietmode=}'[set smartctl quiet mode]:quiet mode:(errorsonly silent noserial)' \ + '(H -d --device)'{-d+,--device=}'[specify device type]:device type:(ata scsi nvme sat usbcypress usbjmicron usbprolific usbsunplus marvell areca 3ware hpt megaraid cciss auto test)' \ + '(H)*'{-T+,--tolerance=}'[specify how tolerant smartctl should be of ATA SMART command failures]:tolerance:(normal conservative permissive verypermissive)' \ + '(H -b --badsum)'{-b+,--badsum=}'[set action if checksum error is detected]:action:(warn exit ignore)' \ + '(H)*'{-r+,--report=}'[report transactions]:transaction type:(ioctl ataioctl scsiioctl nvmeioctl)' \ + '(H -n --nocheck)'{-n+,--nocheck=}'[exit if the device is in a low-power mode]:power mode causing exit:(never sleep standby idle)' \ + '(H -s --smart)--smart=[enable/disable SMART on device]:enable:(on off)' \ + '(H -o --offlineauto)'{-o+,--offlineauto=}'[enable/disable automatic offline test on device]:enable:(on off)' \ + '(H -S --saveauto)'{-S+,--saveauto=}'[enable/disable attribute autosave on device]:enable:(on off)' \ + '(H -s --set)'{-s+,--set=}'[enable/disable/change device setting]:setting:->settings' \ + '(H -H --health)'{-H,--health}'[show device SMART health status]' \ + '(H -c --capabilities)'{-c,--capabilities}'[show device SMART capabilities]' \ + '(H -A --attributes)'{-A,--attributes}'[show device SMART vendor-specific attributes and values]' \ + '(H)*'{-f+,--format=}'[set output format for attributes]:format:(old brief hex,id hex,val hex)' \ + '(H)*'{-l+,--log=}'[show device log]:log:(error selftest selective directory xerror xselftest background sasphy sataphy scttemp scttempsts scttemphist scttempint scterc devstat ssd gplog smartlog nvmelog)' \ + '(H)*'{-v+,--vendorattribute=}'[set display option for vendor attribute]:vendor attribute:->vendorattrs' \ + '(H -F --firmwarebug)'{-F+,--firmwarebug=}'[use firmware bug workaround]:bug:(none nologdir samsung samsung2 samsung3 xerrorlba swapid)' \ + '(H -P --presets)'{-P+,--presets=}'[specify whether to use drive-specific presets]:preset usage:(use ignore show showall)' \ + '(H -B --drivedb)'{-B+,--drivedb=}'[read drive database from file]:file:->plusfiles' \ + '(H -t --test)'{-t+,--test=}'[run specified self-test]:self-test:(offline short long conveyance force vendor select pending afterselect,on afterselect,off scttempint)' \ + '(H -C --captive)'{-C,--captive}'[run self-test in captive mode]' \ + '(H -X --abort)'{-X,--abort}'[abort any non-captive self-test]' \ + '(H --scan --scan-open)1:disk device:_files -g "*(-%)" -P / -W /' \ + + 'H' \ + '(- 1)'{-h,--help,--usage}'[display help information]' \ + '(- 1)'{-V,--version,--copyright,--license}'[display version, licence and build information]' && return + +case $state in + vendorattrs) + _wanted -C $context vendor-attributes expl 'vendor attribute' compadd - \ + ${${${(f)"$(_call_program vendor-attributes $words[1] -v help)"}[(r)*help*,-1]#$'\t'}%%\[*} + ;; + plusfiles) + compset -P \+ || state_descr[1]+=" (prefix with + to prepend entries)" + _wanted -C $context files expl $state_descr _files + ;; + settings) + local values + [[ $context = option-s-1 ]] && + values+=( {on\[en,off\[dis}'able SMART on device]' ) + + _values -S , setting $values {aam,apm,standby}':value' \ + {lookahead,{w,r}cache,wcreorder}':enable:(on off)' security security-freeze + ;; +esac .