From fffe5f114f6da67cd136f50e9f92542360899772 Mon Sep 17 00:00:00 2001 From: Jindrich Pilar Date: Sun, 9 Oct 2016 08:38:50 +0200 Subject: [PATCH 1/6] Completion for trash-put --- src/_trash-put | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/_trash-put diff --git a/src/_trash-put b/src/_trash-put new file mode 100644 index 0000000..0f9ca45 --- /dev/null +++ b/src/_trash-put @@ -0,0 +1,65 @@ +#compdef trash-put +# ------------------------------------------------------------------------------ +# Copyright (c) 2016 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 trash-put a tool from trash management package trash-cli (http://code.google.com/p/trash-cli). +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Jindřich Pilař (https://github.com/JindrichPilar) +# +# ------------------------------------------------------------------------------ + + +_trash-put() { + + +_arguments -C \ + '--version[Show programs version number and exit]' \ + {-h,--help}'[Show help message and exit]' \ + {-d,--directory}'[Remove empty directories - ignored (for GNU rm compabilty)]' \ + {-f,--force}'[Ignore nonexistent arguments and never prompt - ignored (for GNU rm compabilty)]' \ + {-i,--interactive}'[Prompt before every removal - ignored (for GNU rm compabilty)]' \ + {-r,-R,--recursive}'[Remove directories and their content recursively - ignored (for GNU rm compabilty)]' \ + {-v,--verbose}'[Explain what is being done]' \ + '*: :_files' \ + +} + +_trash-put + +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et From b1b04b8d1adc9a5264e3da76f7d442dade7b9bfd Mon Sep 17 00:00:00 2001 From: Jindrich Pilar Date: Sun, 9 Oct 2016 08:41:21 +0200 Subject: [PATCH 2/6] Completion for trash-list --- src/_trash-list | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/_trash-list diff --git a/src/_trash-list b/src/_trash-list new file mode 100644 index 0000000..013780c --- /dev/null +++ b/src/_trash-list @@ -0,0 +1,60 @@ +#compdef trash-list +# ------------------------------------------------------------------------------ +# Copyright (c) 2016 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 trash-list a tool from trash management package trash-cli (http://code.google.com/p/trash-cli). +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Jindřich Pilař (https://github.com/JindrichPilar) +# +# ------------------------------------------------------------------------------ + + +_trash-list() { + + +_arguments -C \ + '--version[Show programs version number and exit]' \ + {-h,--help}'[Show help message and exit]' \ + '*: :' \ + +} + +_trash-list + +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et From 76a62e82f9edc67ee48895be660b591d3137fe1c Mon Sep 17 00:00:00 2001 From: Jindrich Pilar Date: Sun, 9 Oct 2016 08:43:02 +0200 Subject: [PATCH 3/6] Completion for trash-empty --- src/_trash-empty | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/_trash-empty diff --git a/src/_trash-empty b/src/_trash-empty new file mode 100644 index 0000000..dba9ea9 --- /dev/null +++ b/src/_trash-empty @@ -0,0 +1,60 @@ +#compdef trash-empty +# ------------------------------------------------------------------------------ +# Copyright (c) 2016 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 trash-empty a tool from trash management package trash-cli (http://code.google.com/p/trash-cli). +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Jindřich Pilař (https://github.com/JindrichPilar) +# +# ------------------------------------------------------------------------------ + + +_trash-empty() { + + +_arguments -C \ + '--version[Show programs version number and exit]' \ + {-h,--help}'[Show help message and exit]' \ + '*: :' \ + +} + +_trash-empty + +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et From d9fc96f6a34ebf4c7e62e2dd3f3d359be950e196 Mon Sep 17 00:00:00 2001 From: Jindrich Pilar Date: Sun, 9 Oct 2016 08:45:22 +0200 Subject: [PATCH 4/6] trash-put and trash have same competion --- src/_trash-put | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_trash-put b/src/_trash-put index 0f9ca45..8633f65 100644 --- a/src/_trash-put +++ b/src/_trash-put @@ -1,4 +1,4 @@ -#compdef trash-put +#compdef trash-put trash # ------------------------------------------------------------------------------ # Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users # All rights reserved. From 116c85a7d718febeda65ebafb47f5796b8787324 Mon Sep 17 00:00:00 2001 From: Jindrich Pilar Date: Sun, 9 Oct 2016 08:51:19 +0200 Subject: [PATCH 5/6] Completion for trash-restore --- src/_trash-restore | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/_trash-restore diff --git a/src/_trash-restore b/src/_trash-restore new file mode 100644 index 0000000..b521cac --- /dev/null +++ b/src/_trash-restore @@ -0,0 +1,59 @@ +#compdef trash-restore +# ------------------------------------------------------------------------------ +# Copyright (c) 2016 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 trash-restore a tool from trash management package trash-cli (http://code.google.com/p/trash-cli). +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Jindřich Pilař (https://github.com/JindrichPilar) +# +# ------------------------------------------------------------------------------ + + +_trash-restore() { + + +_arguments -C \ + '--version[Show programs version number and exit]' \ + '*: :' \ + +} + +_trash-restore + +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et From d7b0bc8fb2a157ca47af6cd4b777b8bfe58819df Mon Sep 17 00:00:00 2001 From: Jindrich Pilar Date: Sun, 9 Oct 2016 11:13:27 +0200 Subject: [PATCH 6/6] Manualy reformated trash-cli --- src/_trash-empty | 9 ++++----- src/_trash-list | 9 ++++----- src/_trash-put | 19 +++++++++---------- src/_trash-restore | 7 +++---- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/_trash-empty b/src/_trash-empty index dba9ea9..b25ce93 100644 --- a/src/_trash-empty +++ b/src/_trash-empty @@ -41,11 +41,10 @@ _trash-empty() { - -_arguments -C \ - '--version[Show programs version number and exit]' \ - {-h,--help}'[Show help message and exit]' \ - '*: :' \ + _arguments -C \ + '--version[Show programs version number and exit]' \ + {-h,--help}'[Show help message and exit]' \ + '*: :' \ } diff --git a/src/_trash-list b/src/_trash-list index 013780c..0f821c0 100644 --- a/src/_trash-list +++ b/src/_trash-list @@ -41,11 +41,10 @@ _trash-list() { - -_arguments -C \ - '--version[Show programs version number and exit]' \ - {-h,--help}'[Show help message and exit]' \ - '*: :' \ + _arguments -C \ + '--version[Show programs version number and exit]' \ + {-h,--help}'[Show help message and exit]' \ + '*: :' \ } diff --git a/src/_trash-put b/src/_trash-put index 8633f65..e9bf06d 100644 --- a/src/_trash-put +++ b/src/_trash-put @@ -41,16 +41,15 @@ _trash-put() { - -_arguments -C \ - '--version[Show programs version number and exit]' \ - {-h,--help}'[Show help message and exit]' \ - {-d,--directory}'[Remove empty directories - ignored (for GNU rm compabilty)]' \ - {-f,--force}'[Ignore nonexistent arguments and never prompt - ignored (for GNU rm compabilty)]' \ - {-i,--interactive}'[Prompt before every removal - ignored (for GNU rm compabilty)]' \ - {-r,-R,--recursive}'[Remove directories and their content recursively - ignored (for GNU rm compabilty)]' \ - {-v,--verbose}'[Explain what is being done]' \ - '*: :_files' \ + _arguments -C \ + '--version[Show programs version number and exit]' \ + {-h,--help}'[Show help message and exit]' \ + {-d,--directory}'[Remove empty directories - ignored (for GNU rm compabilty)]' \ + {-f,--force}'[Ignore nonexistent arguments and never prompt - ignored (for GNU rm compabilty)]' \ + {-i,--interactive}'[Prompt before every removal - ignored (for GNU rm compabilty)]' \ + {-r,-R,--recursive}'[Remove directories and their content recursively - ignored (for GNU rm compabilty)]' \ + {-v,--verbose}'[Explain what is being done]' \ + '*: :_files' \ } diff --git a/src/_trash-restore b/src/_trash-restore index b521cac..35e313a 100644 --- a/src/_trash-restore +++ b/src/_trash-restore @@ -41,10 +41,9 @@ _trash-restore() { - -_arguments -C \ - '--version[Show programs version number and exit]' \ - '*: :' \ + _arguments -C \ + '--version[Show programs version number and exit]' \ + '*: :' \ }