aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-08-27 15:50:48 +0300
committerThomas Voss <mail@thomasvoss.com> 2023-08-27 15:50:48 +0300
commitcba433e2f46cd9d492e01b60da4d4319f3d602ba (patch)
treeecaa97c4e3fa52ba3f841c4b1d1db3ac18f2b499
parenta6459edfaa08085211fb60f41be5ec3e75305e0c (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-xmkpass7
-rw-r--r--mkpass.13
2 files changed, 3 insertions, 7 deletions
diff --git a/mkpass b/mkpass
index d1acc08..0eff77d 100755
--- a/mkpass
+++ b/mkpass
@@ -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
diff --git a/mkpass.1 b/mkpass.1
index 84c269f..687d3b5 100644
--- a/mkpass.1
+++ b/mkpass.1
@@ -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