From a254d2f43648b5d932da7de4bfdb0f1bf476f0ef Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Sat, 18 Apr 2015 23:45:05 +0200 Subject: [PATCH] [repo-encrypt] Bash completion added For the repo-encrypt script, some bash completion is added. The Makefile is adjusted for to install these scripts. Also the README is updated with instructions. --- Makefile | 12 ++++++++++- README | 38 ++++++++++++++++++++++++---------- bash_completion.d/repo-encrypt | 32 ++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 12 deletions(-) create mode 100644 bash_completion.d/repo-encrypt diff --git a/Makefile b/Makefile index f789392..db29e8d 100644 --- a/Makefile +++ b/Makefile @@ -8,15 +8,25 @@ scripts = \ msmtp-notify \ repo-encrypt \ +bash-completion = \ +repo-encrypt \ + dir := $(abspath $(wildcard $(INSTALL))) +dir-completion := $(dir)/bash_completion.d default: help -install: $(foreach s, $(scripts), $(dir)/$(s)) +install: $(dir) $(dir-completion) \ +$(foreach f, $(scripts), $(dir)/$(f)) \ +$(foreach f, $(bash-completion), $(dir-completion)/$(f)) \ $(dir)/%: % cp -f $< $@ chmod +x $@ +$(dir-completion)/%: bash_completion.d/% + cp -f $< $@ +$(dir) $(dir-completion): + mkdir -p $@ help: @echo "Run make install or see README." diff --git a/README b/README index 70cac42..a7b3912 100644 --- a/README +++ b/README @@ -3,9 +3,11 @@ This repository holds cusomisation scripts of Gustav. Please send patches, bug reports and comments to Gustav Eek -# Licence -Copyright 2014 Gustav Eek. +License +======= + +Copyright (c) 2014--2015 Gustav Eek . The script set in this repository is free software: you can redistribute it and/or modify it under the terms of the GNU General @@ -21,22 +23,36 @@ You should have received a copy of the GNU General Public License along with this script set. If not, see . -# Configuration - -Configural parameters are installation directory. Open Makefile -# Compilation +Configuration +============= -No compilation is needed. +Configurable parameters are installation directory. Edit `Makefile` +directly. -# Installation +Installation +============ For installation type - $ make install + $ make install + +For Bash autocompletion on some of the commands, put the following +lines in your `~/.bash_completion` or `~/.bashrc` + + DIR="$HOME/bin/bash_completion.d" + if [[ -d "$DIR" ]]; then + for f in $(ls "$DIR"); do + if [[ -f "$DIR/$f" ]]; then + source "$DIR/$f" + fi + done + fi + unset DIR -# Help +Help +==== Some scripts include help command, in that case type - $