Hey list, arriving home from SambaXP, it was really nice. That darth vader cake was super sweet :-) Hearing some people talking about how much they'd like bash completion for `samba-tool`, I've put together an ugly script that does that. It's a very dumb script (I'm boldly calling it script), but it might make someones day a little bit easier. https://gist.github.com/ls42/0dca178759e42c04e685 It does complete commands and subcommands of two levels, e.g. - samba-tool domain provision - samba-tool group addmember and so on can be completed. It also completes subcommands that are not valid (like samba-tool gpo addmember), since I just added a bunch of text to bash's `complete`. On Debian it can be saved under `/etc/bash_completion.d/` (does exist at least since jessie). A log-out/-in might be required. Or just source it. Stephan Brauer
Johannes Amorosa | Celluloid VFX
2015-May-27 16:37 UTC
[Samba] Bash-Completion for samba-tool
Thank you. This is very useful. On 05/21/2015 10:02 PM, Stephan Brauer wrote:> Hey list, > > arriving home from SambaXP, it was really nice. That darth vader cake was > super sweet :-) > > Hearing some people talking about how much they'd like bash completion > for `samba-tool`, I've put together an ugly script that does that. > > It's a very dumb script (I'm boldly calling it script), but it might make > someones day a little bit easier. > > https://gist.github.com/ls42/0dca178759e42c04e685 > > It does complete commands and subcommands of two levels, e.g. > > - samba-tool domain provision > - samba-tool group addmember > > and so on can be completed. It also completes subcommands that are not > valid (like samba-tool gpo addmember), since I just added a bunch of text > to bash's `complete`. > > On Debian it can be saved under `/etc/bash_completion.d/` (does exist at > least since jessie). A log-out/-in might be required. Or just source it. > > Stephan Brauer-- Johannes Amorosa | Celluloid VFX
On 05/21/2015 01:02 PM, Stephan Brauer wrote:> Hey list, > > arriving home from SambaXP, it was really nice. That darth vader cake was > super sweet :-) > > Hearing some people talking about how much they'd like bash completion > for `samba-tool`, I've put together an ugly script that does that. > > It's a very dumb script (I'm boldly calling it script), but it might make > someones day a little bit easier. > > https://gist.github.com/ls42/0dca178759e42c04e685 > > It does complete commands and subcommands of two levels, e.g. > > - samba-tool domain provision > - samba-tool group addmember > > and so on can be completed. It also completes subcommands that are not > valid (like samba-tool gpo addmember), since I just added a bunch of text > to bash's `complete`. > > On Debian it can be saved under `/etc/bash_completion.d/` (does exist at > least since jessie). A log-out/-in might be required. Or just source it. > > Stephan BrauerCan you work with upstream distros to get it in ? Should it be part of the samba package or from the bash packagE ? -- Matthieu Patou Samba Team http://samba.org
Am 01.06.2015 um 21:54 schrieb Matthieu Patou:> Can you work with upstream distros to get it in ? > Should it be part of the samba package or from the bash packagE?bash completions are typically part of the package or at least should be whenever it is possible some are parts of "bash-completion" package itself but that don't scale and is not maintainable because it should match the installed version of the software and you can't update "bash-completion" everytime a random package adds or fixes something it that context [harry at srv-rhsoft:~]$ rpm -q --file /usr/share/bash-completion/completions/svnlook subversion-1.8.11-1.fc21.x86_64 [harry at srv-rhsoft:~]$ rpm -q --file /usr/share/bash-completion/completions/yum yum-3.4.3-153.fc21.noarch -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 181 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/samba/attachments/20150601/f6adcabf/attachment.pgp>