diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-08-27 15:50:48 +0300 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-08-27 15:50:48 +0300 |
commit | cba433e2f46cd9d492e01b60da4d4319f3d602ba (patch) | |
tree | ecaa97c4e3fa52ba3f841c4b1d1db3ac18f2b499 | |
parent | a6459edfaa08085211fb60f41be5ec3e75305e0c (diff) |
Remove the bloated ā-nā optionv2.0.0
If you need to copy a password without a newline, just do:
$ mkpass | wl-copy -n
If you just happen to need no newlines for other purposes:
$ mkpass | xargs printf '%s'
-rwxr-xr-x | mkpass | 7 | ||||
-rw-r--r-- | mkpass.1 | 3 |
2 files changed, 3 insertions, 7 deletions
@@ -3,14 +3,13 @@ set -e usage() { - echo "Usage: ${0##*/} [-n] [-l length] [chars]" >&2 + echo "Usage: ${0##*/} [-l length] [chars]" >&2 exit 1 } -while getopts 'l:n' o; do +while getopts 'l:' o; do case "$o" in l) len="$OPTARG" ;; - n) nnl=false ;; *) usage ;; esac done @@ -18,4 +17,4 @@ done shift $((OPTIND - 1)) [ $# -gt 1 ] && usage </dev/urandom tr -dc -- "${1:-[:graph:]}" | head -c "${len:-64}" -${nnl:-true} && echo +echo @@ -6,7 +6,6 @@ .Nd make a password .Sh SYNOPSIS .Nm -.Op Fl n .Op Fl l Ar length .Op Ar chars .Sh DESCRIPTION @@ -27,8 +26,6 @@ section. .Pp The options are as follows: .Bl -tag width Ds -.It Fl n -Do not print a trailing newline after the generated password. .It Fl l Ar length Generate a password .Ar length |