diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-19 13:54:26 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-19 13:54:26 +1300 |
commit | aaac7a0927481249f177a69976d30eaa3af53f97 (patch) | |
tree | 7c9e84b2e5cbb325025b4be60520081a92da00a7 | |
parent | Remove diff()/rcsdiff() function wrappers (diff) | |
download | dotfiles-aaac7a0927481249f177a69976d30eaa3af53f97.tar.gz dotfiles-aaac7a0927481249f177a69976d30eaa3af53f97.zip |
Move pwgen() wrapper into pwg(1df)
-rw-r--r-- | README.markdown | 2 | ||||
-rwxr-xr-x | bin/pwg | 7 | ||||
-rw-r--r-- | man/man1/pwg.1df | 16 | ||||
-rw-r--r-- | sh/shrc.d/pwgen.sh | 7 |
4 files changed, 24 insertions, 8 deletions
diff --git a/README.markdown b/README.markdown index 4d76f1e1..4ee87165 100644 --- a/README.markdown +++ b/README.markdown @@ -190,7 +190,6 @@ in `sh/shrc.d` to be loaded by any POSIX interactive shell. Those include: `~/.mysql`. * `path()` manages the contents of `PATH` conveniently. * `pd()` changes to the argument's parent directory. -* `pwgen()` generates just one decent password with `pwgen(1)`. * `rd()` replaces the first instance of its first argument with its second argument in `$PWD`, emulating a feature of the Zsh `cd` builtin that I like. @@ -473,6 +472,7 @@ Installed by the `install-bin` target: * `plmu(1df)` retrieves a list of installed modules from [`plenv`](https://github.com/tokuhirom/plenv), filters out any modules in `~/.plenv/non-cpan-modules`, and updates them all. +* `pwg(1df)` generates just one decent password with `pwgen(1)`. * `rgl(1df)` is a very crude interactive `grep(1)` loop. * `shb(1df)` attempts to build shebang lines for scripts from the system paths. diff --git a/bin/pwg b/bin/pwg new file mode 100755 index 00000000..219de003 --- /dev/null +++ b/bin/pwg @@ -0,0 +1,7 @@ +#!/bin/sh +# Shortcut to generate just one strong password with pwgen(1) +# If any arguments are provided, those are used instead +if [ "$#" -eq 0 ] ; then + set -- --secure -- "${PWGEN_LENGTH:-15}" "${PWGEN_COUNT:-1}" +fi +pwgen "$@" diff --git a/man/man1/pwg.1df b/man/man1/pwg.1df new file mode 100644 index 00000000..3bc2e777 --- /dev/null +++ b/man/man1/pwg.1df @@ -0,0 +1,16 @@ +.TH PWG 1df "December 2016" "Manual page for pwg" +.SH NAME +.B pwg +\- generate just one secure password without symbols with pwgen(1) +.SH SYNOPSIS +.B pwg +.SH DESCRIPTION +.B pwg +with no arguments runs pwgen(1) with the --secure options and arguments for one +password of fifteen alphanumeric characters, to avoid pwgen(1)'s unusual +default of generating very many relatively low-quality passwords, which is +never what the author wants. +.P +If any arguments are provided, it simply passes these to pwgen(1) untouched. +.SH AUTHOR +Tom Ryder <tom@sanctum.geek.nz> diff --git a/sh/shrc.d/pwgen.sh b/sh/shrc.d/pwgen.sh deleted file mode 100644 index 510349eb..00000000 --- a/sh/shrc.d/pwgen.sh +++ /dev/null @@ -1,7 +0,0 @@ -# Set some defaults for pwgen(1), because its defaults are to give me a long -# list of relatively short passwords, when I generally want only one good one -pwgen() { - [ "$#" -eq 0 ] && - set -- --secure -- "${PWGEN_LENGTH:-15}" "${PWGEN_COUNT:-1}" - command pwgen "$@" -} |