diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-03-12 10:05:39 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-03-12 10:05:39 +1300 |
commit | 71ee07fd12df173a7bc7fd1a7479cd09986f7956 (patch) | |
tree | 413ac38ee6650175001352467efe20c8bf5cb0bd /bash/bashrc.d | |
parent | Update Vim plugins (diff) | |
download | dotfiles-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.bash | 6 | ||||
-rw-r--r-- | bash/bashrc.d/pwgen.bash | 2 | ||||
-rw-r--r-- | bash/bashrc.d/remind.bash | 6 |
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}" } |