aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-03-12 10:05:39 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-03-12 10:05:39 +1300
commit71ee07fd12df173a7bc7fd1a7479cd09986f7956 (patch)
tree413ac38ee6650175001352467efe20c8bf5cb0bd /bash/bashrc.d
parentUpdate Vim plugins (diff)
downloaddotfiles-71ee07fd12df173a7bc7fd1a7479cd09986f7956.tar.gz
dotfiles-71ee07fd12df173a7bc7fd1a7479cd09986f7956.zip
Simplify a few default value settings
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/pushd.bash6
-rw-r--r--bash/bashrc.d/pwgen.bash2
-rw-r--r--bash/bashrc.d/remind.bash6
3 files changed, 3 insertions, 11 deletions
diff --git a/bash/bashrc.d/pushd.bash b/bash/bashrc.d/pushd.bash
index 6da42fee..c3e01a5e 100644
--- a/bash/bashrc.d/pushd.bash
+++ b/bash/bashrc.d/pushd.bash
@@ -1,9 +1,5 @@
# Make pushd default to $HOME if no arguments given, much like cd
pushd() {
- if (($#)) ; then
- builtin pushd "$@"
- else
- builtin pushd -- "$HOME"
- fi
+ builtin pushd "${@:-$HOME}"
}
diff --git a/bash/bashrc.d/pwgen.bash b/bash/bashrc.d/pwgen.bash
index 10cd3a41..1ac80505 100644
--- a/bash/bashrc.d/pwgen.bash
+++ b/bash/bashrc.d/pwgen.bash
@@ -4,7 +4,7 @@ pwgen() {
if (($#)) ; then
command pwgen "$@"
else
- command pwgen -s -- "${PWGEN_LENGTH:-15}" "${PWGEN_COUNT:-1}"
+ command pwgen --secure -- "${PWGEN_LENGTH:-15}" "${PWGEN_COUNT:-1}"
fi
}
diff --git a/bash/bashrc.d/remind.bash b/bash/bashrc.d/remind.bash
index 88d094af..eaa724e0 100644
--- a/bash/bashrc.d/remind.bash
+++ b/bash/bashrc.d/remind.bash
@@ -1,9 +1,5 @@
# Default filename for remind(1) is ~/.reminders
remind() {
- if ! (($#)) && [[ -r "$HOME"/.reminders ]] ; then
- command remind "$HOME"/.reminders
- else
- command remind "$@"
- fi
+ command remind "${@:-"$HOME"/.reminders}"
}