From 16cf3ed1f91ee437a112d1a8d742b3108cee3a0c Mon Sep 17 00:00:00 2001 From: Tomo Kazahaya Date: Thu, 17 Aug 2017 21:35:33 -0400 Subject: [PATCH] Add completion script for xsel --- src/_xsel | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/_xsel diff --git a/src/_xsel b/src/_xsel new file mode 100644 index 0000000..3ba249b --- /dev/null +++ b/src/_xsel @@ -0,0 +1,63 @@ +#compdef xsel +# ------------------------------------------------------------------------------ +# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the zsh-users nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for xsel (http://www.vergenet.net/~conrad/software/xsel/). +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Tomo Kazahaya (https://github.com/tomonacci) +# +# ------------------------------------------------------------------------------ + +local input='(-a --append -f --follow -i --input)' +local operation='(-c --clear -d --delete -k --keep -x --exchange)' +local selection='(-p --primary -s --secondary -b --clipboard)' + +_arguments -s \ + $input{-a,--append}'[append standard input to the selection]' \ + $input{-f,--follow}'[append to selection as standard input grows]' \ + $input{-i,--input}'[read standard input into the selection]' \ + {-o,--output}'[write the selection to standard output]' \ + $operation{-c,--clear}'[clear the selection]' \ + $operation{-d,--delete}'[request that the current selection be deleted]' \ + $selection{-p,--primary}'[operate on the PRIMARY selection (default)]' \ + $selection{-s,--secondary}'[operate on the SECONDARY selection]' \ + $selection{-b,--clipboard}'[operate on the CLIPBOARD selection]' \ + $operation{-k,--keep}'[do not modify the selections, but make the PRIMARY and SECONDARY selections persist even after the programs they were selected in exit]' \ + $operation{-x,--exchange}'[exchange the PRIMARY and SECONDARY selections]' \ + '--display[specify the server to use; see X(1)]:X display:_x_display' \ + {-t,--selectionTimeout}'[specify the timeout in milliseconds within which the selection must be retrieved]:number' \ + {-l,--logfile}'[specify the file to log errors to when detached (default $HOME/.xsel.log)]:log file:_files' \ + {-n,--nodetach}'[do not detach from the controlling terminal]' \ + {-h,--help}'[display usage information and exit]' \ + {-v,--verbose}'[print informative messages; additional instances of -v raise the debugging level]' \ + '--version[output version information and exit]'