[arch-general] rc.d bash completion
i wrote a very simple rc.d bash completion script. is there any chance it can be used upstream? the script is uploaded to http://paste.pocoo.org/show/391283/ it is also copy-pasted here for your convenience: #!/bin/bash _rc.d_getdaemons () { /usr/bin/find "$1" -mindepth 1 -maxdepth 1 -type f -printf '%f\n' } _rc.d_arraydiff () { local arr declare -A arr for elem in "${!1}" do arr[$elem]=1 done for elem in "${!2}" do unset arr[$elem] done echo "${!arr[@]}" } _rc.d () { local command commands available started local cur words cword commands="list help start stop restart" available=($(_rc.d_getdaemons /etc/rc.d)) started=($(_rc.d_getdaemons /run/daemons)) _get_comp_words_by_ref -n =: cur words cword [ $cword -gt 1 ] && command=${words[1]} if [ -z "$command" ] then COMPREPLY=($(compgen -W "$commands" -- $cur)) else case "$command" in start) COMPREPLY=($(compgen -W "$(_rc.d_arraydiff \ available[@] started[@])" -- $cur)) ;; stop|restart) COMPREPLY=($(compgen -W "$(echo ${started[@]})" -- $cur)) ;; list|help|*) COMPREPLY=() ;; esac fi } complete -F _rc.d rc.d
On Wed, May 18, 2011 at 6:13 PM, Auguste Pop <auguste@gmail.com> wrote:
i wrote a very simple rc.d bash completion script. is there any chance it can be used upstream?
Thanks for your work! If you make a git patch (so we get proper authorship info etc) and send it to arch-projcets@archlinux.org for review then it can almost certainly be used. Just as long as Seblu signs off on it, I'll be happy to apply it. Cheers, Tom PS It would be extra cool if your patch also adds this to the Makefile so it gets installed correctly.
On Thu, May 19, 2011 at 12:21 AM, Tom Gundersen <teg@jklm.no> wrote:
On Wed, May 18, 2011 at 6:13 PM, Auguste Pop <auguste@gmail.com> wrote:
i wrote a very simple rc.d bash completion script. is there any chance it can be used upstream?
Thanks for your work!
If you make a git patch (so we get proper authorship info etc) and send it to arch-projcets@archlinux.org for review then it can almost certainly be used. Just as long as Seblu signs off on it, I'll be happy to apply it.
Cheers,
Tom
PS It would be extra cool if your patch also adds this to the Makefile so it gets installed correctly.
i am not familiar with git, i did it by git clone, git branch, git commit, and git show. the mail will be sent soon after this reply. ;-)
On Wed, May 18, 2011 at 6:43 PM, Auguste Pop <auguste@gmail.com> wrote:
i am not familiar with git, i did it by git clone, git branch, git commit, and git show. the mail will be sent soon after this reply. ;-)
That looked about right (git wise, haven't looked at the code). Cheers, -t
On Wed, May 18, 2011 at 7:04 PM, Tom Gundersen <teg@jklm.no> wrote:
On Wed, May 18, 2011 at 6:43 PM, Auguste Pop <auguste@gmail.com> wrote:
i am not familiar with git, i did it by git clone, git branch, git commit, and git show. the mail will be sent soon after this reply. ;-)
That looked about right (git wise, haven't looked at the code).
I have a patch about rc.d bash completion pending since 5 may... https://github.com/seblu/arch-initscripts/commit/ce18321029e746a0417c65762c6... Tom can you pull my branch? -- Sébastien Luttringer www.seblu.net
On 05/18/2011 03:00 PM, Seblu wrote:
I have a patch about rc.d bash completion pending since 5 may...
https://github.com/seblu/arch-initscripts/commit/ce18321029e746a0417c65762c6...
Tom can you pull my branch?
Errr ... perhaps you want to rephrase that? :-) DR
Auguste Pop wrote:
i wrote a very simple rc.d bash completion script. is there any chance it can be used upstream?
I noticed earlier theres one for zsh in the AUR as well. I was about to suggest to the author to send it upstream but negelcted to. https://aur.archlinux.org/packages.php?ID=49136 Greg -- () against html e-mail | usenet & email communication netiquette /\ www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
Le 18/05/2011 18:24, Grigorios Bouzakis a écrit :
Auguste Pop wrote:
i wrote a very simple rc.d bash completion script. is there any chance it can be used upstream?
I noticed earlier theres one for zsh in the AUR as well. I was about to suggest to the author to send it upstream but negelcted to. https://aur.archlinux.org/packages.php?ID=49136
Greg
Hello, I'm the author of the complection script for zsh and ok i can make a git patch. Clément -- Clef GPG : 0xDD51E028
2011/5/18 Clément Démoulins <clement@archivel.fr>:
Le 18/05/2011 18:24, Grigorios Bouzakis a écrit :
Auguste Pop wrote:
i wrote a very simple rc.d bash completion script. is there any chance it can be used upstream?
I noticed earlier theres one for zsh in the AUR as well. I was about to suggest to the author to send it upstream but negelcted to. https://aur.archlinux.org/packages.php?ID=49136
Greg
Hello, I'm the author of the complection script for zsh and ok i can make a git patch.
Thanks! I'll route all this through Seblu (just write to arch-projects@archlinux.org) as he is the one working on rc.d (and he has some outstanding patches, so better let him coordinate it). Cheers, Tom
Le 18/05/2011 22:31, Tom Gundersen a écrit :
2011/5/18 Clément Démoulins <clement@archivel.fr>:
Le 18/05/2011 18:24, Grigorios Bouzakis a écrit :
Auguste Pop wrote:
i wrote a very simple rc.d bash completion script. is there any chance it can be used upstream?
I noticed earlier theres one for zsh in the AUR as well. I was about to suggest to the author to send it upstream but negelcted to. https://aur.archlinux.org/packages.php?ID=49136
Greg
Hello, I'm the author of the complection script for zsh and ok i can make a git patch.
Thanks! I'll route all this through Seblu (just write to arch-projects@archlinux.org) as he is the one working on rc.d (and he has some outstanding patches, so better let him coordinate it).
Cheers,
Tom
I tried to send the patch to arch-projects@archlinux.org but i'm not allowed to post in this mailing list. I join the patch if you can send it. Clément -- Clef GPG : 0xDD51E028
On Wed, May 18, 2011 at 10:42:31PM +0200, Clément Démoulins wrote:
I tried to send the patch to arch-projects@archlinux.org but i'm not allowed to post in this mailing list. I join the patch if you can send it. Subscribe to the mailing list at <http://mailman.archlinux.org/mailman/listinfo/arch-projects> and you will be able to send it. -- -- Kwpolska (http://kwpolska.co.cc) stop html mail | always bottom-post www.asciiribbon.org | www.netmeister.org/news/learn2quote.html GPG KEY: 5EAAEA16 | Arch Linux x86_64, zsh, mutt, vim.
Le 19/05/2011 15:49, Kwpolska a écrit :
On Wed, May 18, 2011 at 10:42:31PM +0200, Clément Démoulins wrote:
I tried to send the patch to arch-projects@archlinux.org but i'm not allowed to post in this mailing list. I join the patch if you can send it. Subscribe to the mailing list at <http://mailman.archlinux.org/mailman/listinfo/arch-projects> and you will be able to send it.
Done. -- Clef GPG : 0xDD51E028
participants (7)
-
Auguste Pop
-
Clément Démoulins
-
David Rosenstrauch
-
Grigorios Bouzakis
-
Kwpolska
-
Seblu
-
Tom Gundersen