diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-06-04 20:26:53 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-06-04 20:26:53 -0700 |
| commit | 64aaffb068b10848211d29951fdf24b8b967103f (patch) | |
| tree | fc532730598db8b9fba3cc933567d3f7137ba992 /ask.1 | |
| parent | 904af4e28d8f73329eaf25bcf0693f53953c47d0 (diff) | |
Added manpage
Diffstat (limited to 'ask.1')
| -rw-r--r-- | ask.1 | 68 |
1 files changed, 68 insertions, 0 deletions
@@ -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) |
