From 64aaffb068b10848211d29951fdf24b8b967103f Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 4 Jun 2019 20:26:53 -0700 Subject: [PATCH] Added manpage --- ask.1 | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 ask.1 diff --git a/ask.1 b/ask.1 new file mode 100644 index 0000000..3d262dd --- /dev/null +++ b/ask.1 @@ -0,0 +1,68 @@ +.\" Manpage for ask. +.\" Contact bruce@bruce-hill.com to correct errors or typos. +.TH man 8 "4 June 2019" "1.0" "bb manual page" +.SH NAME +ask \- A tiny command line tool for getting user input +.SH SYNOPSIS +.B ask +[\fI-hpqv\fR] +[\fI--initial=initial\fR] +[\fIprompt \fR +[\fIinitial\fR +[\fIoptions...\fR]]] +.SH DESCRIPTION +\fBask\fR is a tiny console application that displays a prompt, gets user input +(with line editing and fuzzy finding functionality), and prints the result to +standard output +.SH OPTIONS +.B \-q +.B \--quickpick +When used with fuzzy finding, as soon as exactly one match is found, exit and +print it. + +.B \-p +.B \--password +Use password mode, which does not print user input as it's being typed. + +.B \-v +.B \--version +Print \fBask\fR's version and exit. + +.B \-h +.B \--help +Print ask's usage and exit. + +.B \--initial=initial +If given, pre-populate the user input with this value. + +.B prompt +If provided, display the given prompt in bold. (Default: "> ") + +.B options... +If additional command line arguments are provided, or if any input is piped in, +\fBask\fR will operate in fuzzy finding mode, attempting to pick one of the +given options. + +.SH EXAMPLES +.TP +.B +foo="`ask 'What is foo? '`" +Store user input in a variable. (Equivalent of \fBread -p 'What is foo? ' foo\fR) + +.TP +.B +rm "`ls | ask 'Delete file: '`" +Fuzzy find a file. (Equivalent of \fBrm "`ls | fzf --prompt='Delete file: '`"\fR) + +.TP +.B +if test "`ask -q 'Do thing? [Y/n] ' '' Y N`" != N; then dothing; fi +Ask user for confirmation (default: yes). + +.TP +.B +if test "`ask -q 'Do thing? [y/N] ' '' Y N`" = Y; then dothing; fi +Ask user for confirmation (default: no). + +.SH AUTHOR +Bruce Hill (bruce@bruce-hill.com)