From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19475 invoked by alias); 15 Oct 2017 18:59:40 -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: List-Unsubscribe: X-Seq: 41904 Received: (qmail 5367 invoked by uid 1010); 15 Oct 2017 18:59:40 -0000 X-Qmail-Scanner-Diagnostics: from webmail.math.cmu.edu 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(128.2.32.135):SA:0(-0.3/5.0):. Processed in 1.319254 secs); 15 Oct 2017 18:59:40 -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=-0.3 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: gi1242+zsh@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Date: Sun, 15 Oct 2017 14:59:32 -0400 From: gi1242+zsh@gmail.com To: zsh-workers@zsh.org Subject: [patch] Completion for _deborphan and _xrandr Message-ID: <20171015185931.ano4dq3c5tevu5jf@andrew.cmu.edu> Mail-Followup-To: gi1242+zsh@gmail.com, zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="yzq3hogdzwkdwgjt" Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) --yzq3hogdzwkdwgjt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi There, I wrote a rudimentary completion script for deborphan (which probably belongs with the Debian completion commands). I also fixed the xrandr completion to separate outputs into two groups (connected and disconnected). Patch, and whole file attached. If there is a preferred way to submit this (e.g. by forking a git repository) let me know and I would be happy to do so. Best, Gautam -- Microsoft broke Volkswagen's world record: Volkswagen only made 22 million bugs! --yzq3hogdzwkdwgjt Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="_xrandr.patch" diff --git a/Completion/X/Command/_xrandr b/Completion/X/Command/_xrandr index b0851569e..26d8cd082 100644 --- a/Completion/X/Command/_xrandr +++ b/Completion/X/Command/_xrandr @@ -58,8 +58,11 @@ case $state in esac ;; outputs) - _wanted outputs expl output compadd \ - ${(uo)${(M)${(f)"$(_call_program outputs xrandr)"}:#* connected*}%% *} && return 0 + local -a xrandr_output=(${(f)"$(_call_program outputs xrandr)"}) + _alternative \ + 'connected:connected outputs:('${(j: :)${(uo)${(M)xrandr_output:#* connected*}%% *}}')' \ + 'disconnected:disconnected outputs:('${(j: :)${(uo)${(M)xrandr_output:#* disconnected*}%% *}}')' \ + && return 0 ;; modes) _wanted modes expl mode compadd \ --yzq3hogdzwkdwgjt Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=_deborphan #compdef deborphan local keep=/var/lib/deborphan/keep _arguments : \ {--help,-h}'[help]' \ {--status-file,-f}'[statusfile]:file:_files' \ {--version,-v}'[version]' \ {--show-deps,-d}'[show dependencies for packages that have them]' \ {--show-priority,-P}'[show priority of packages found]' \ {--show-section,-s}'[show the sections the packages are in]' \ --no-show-section'[do not show sections]' \ {--show-size,-z}'[show installed size of packages found]' \ {--all-packages,-a}'[compare all packages, not just libs]' \ {--exclude,-e}'[work as if packages in LIST were not installed]:LIST:' \ {--force-hold,-H}'[Ignore hold flags.]' \ {--nice-mode,-n}'[Disable checks for "recommends" and "suggests".]' \ --ignore-recommends'[Disable checks for recommends.]' \ --ignore-suggests'[Disable checks for "suggests".]' \ {--priority,-p}'[PRIOR Select only packages with priority >= PRIOR.]:PRIOR:' \ --find-config'[Find "orphaned" configuration files.]' \ --libdevel'[Search in libdevel in addition to libs and oldlibs.]' \ {--add-keep,-A}'[PKGS.. Never report PKGS.]:*:package:_deb_packages installed' \ {--keep-file,-k}'[Use FILE to get/store info about kept packages.]:file:_files' \ {--list-keep,-L}'[List the packages that are never reported.]' \ {--del-keep,-R}"[PKGS.. Remove PKGS from the 'keep' file.]:*:package:_values package $(< $keep)" \ {--zero-keep,-Z}'[Remove all packages from the "keep" file.]' \ --guess-common'[Try to report common packages.]' \ --guess-data'[Try to report data packages.]' \ --guess-debug'[Try to report debugging libraries.]' \ --guess-dev'[Try to report development packages.]' \ --guess-doc'[Try to report documentation packages.]' \ --guess-dummy'[Try to report dummy packages.]' \ --guess-kernel'[Try to report kernel modules.]' \ --guess-interpreters'[Try to report interpreter libraries.]' \ --guess-mono'[Try to report mono libraries.]' \ --guess-perl'[Try to report perl libraries.]' \ --guess-pike'[Try to report pike libraries.]' \ --guess-python'[Try to report python libraries.]' \ --guess-ruby'[Try to report ruby libraries.]' \ --guess-section'[Try to report libraries in wrong sections.]' \ --guess-all'[Try all of the above.]' \ --guess-only'[Use --guess options only.]' --yzq3hogdzwkdwgjt Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=_xrandr #compdef xrandr local curcontext="$curcontext" state line expl typeset -A opt_args _arguments -C \ '(-d -display)'{-d,-display}':X display:_x_display' \ '-help[display help]' \ '(-o --orientation)'{-o,--orientation}':rotation:(normal inverted left right 0 1 2 3)' \ '(-q --query)'{-q,--query}'[display current state]' \ '(-s --size)'{-s,--size}':size:' \ '(-r --rate --refresh)'{*-r,*--rate,*--refresh}':target refresh rate:' \ '(-v --version)'{-v,--version}'[display version]' \ '-x[reflect across X axis]' \ '-y[reflect across Y axis]' \ '--screen:X screen number' \ '--verbose[be more verbose]' \ '--dryrun' \ '--nograb' \ '(--prop --properties)'{--prop,--properties}'[display the contents of properties for each output]' \ '--fb:size:' \ '--fbmm:size:' \ '--dpi:dpi:' \ "*--output:output to reconfigure:->outputs" \ '*--auto' \ "*--mode:mode:->modes" \ '*--preferred' \ '*--pos:position:' \ '*--reflect:axes:(normal x y xy)' \ '*--rotate:rotation:(normal inverted left right)' \ "*--left-of:relative position to:->outputs" \ "*--right-of:relative position to:->outputs" \ "*--above:relative position to:->outputs" \ "*--below:relative position to:->outputs" \ "*--same-as:relative position to:->outputs" \ '*--set:property:(Backlight scaling\ mode):value:->value' \ '*--scale:output scaling:' \ '*--transform:transformation matrix:' \ '*--off[disable the output]' \ '*--crtc:crtc to use:' \ '*--panning:panning:' \ '*--gamma:r\:g\:b:' \ '*--primary' \ '--noprimary' \ '*--newmode:name: :clock MHz: :hdisp: :hsync-start: :hsync-end: :htotal: :vdisp: :vsync-start: :vsync-end: :vtotal:' \ '*--rmmode:Mode name:' \ "*--addmode:output:->outputs:name" \ "*--delmode:output:->outputs:name" \ && return 0 case $state in value) case $words[CURRENT-1] in (scaling*" mode") _description value expl "output property 'scaling mode'" compadd "$@" "$expl[@]" None Full Center Full\ aspect && return 0 ;; esac ;; outputs) local -a xrandr_output=(${(f)"$(_call_program outputs xrandr)"}) _alternative \ 'connected:connected outputs:('${(j: :)${(uo)${(M)xrandr_output:#* connected*}%% *}}')' \ 'disconnected:disconnected outputs:('${(j: :)${(uo)${(M)xrandr_output:#* disconnected*}%% *}}')' \ && return 0 ;; modes) _wanted modes expl mode compadd \ ${(Mun)$(_call_program modes xrandr):#[0-9]##x[0-9]##} && return 0 ;; esac --yzq3hogdzwkdwgjt--