(92 lines)
1 .\" Manpage for ask.2 .\" Contact bruce@bruce-hill.com to correct errors or typos.3 .TH man 8 "4 June 2019" "1.0" "ask manual page"4 .SH NAME5 ask \- A tiny command line tool for getting user input6 .SH SYNOPSIS7 .B ask8 [\fI-Q\fR|\fI--quickpick\fR]9 [\fI-P\fR|\fI--password\fR]10 [\fI-0\fR|\fI--read0\fR]11 [\fI-y\fR|\fI--yes\fR]12 [\fI-n\fR|\fI--no\fR]13 [(\fI-H \fR|\fI--history=\fR) name]14 [\fI-h\fR|\fI--help\fR]15 [\fI-v\fR|\fI--version\fR]16 [(\fI-q\fR |\fI--query=\fR) initial]17 [(\fI-p\fR |\fI--prompt=\fR) prompt]18 [\fIoptions...\fR]19 .SH DESCRIPTION20 \fBask\fR is a tiny console application that displays a prompt, gets user input21 (with line editing and fuzzy finding functionality), and prints the result to22 standard output23 .SH OPTIONS24 .B \-Q25 .B \--quickpick26 When used with fuzzy finding, as soon as exactly one match is found, exit and27 print it.29 .B \-P30 .B \--password31 Use password mode, which does not print user input as it's being typed.33 .B \-034 .B \--read035 Read input delineated by NULL bytes instead of newlines.37 .B \-v38 .B \--version39 Print \fBask\fR's version and exit.41 .B \-h42 .B \--help43 Print \fBask\fR's usage and exit.45 .B \-q <query>46 .B \--query=<query>47 If given, pre-populate the user input with this value.49 .B \-p <prompt>50 .B \--prompt=<prompt>51 If provided, display the given prompt in bold. If the \fI-p\fR and52 \fI--prompt=\fR flags are not used, the first positional argument is used as53 the prompt, or \fB"> "\fR if there are no positional arguments.55 .B \-H <file>56 .B \--history=<file>57 Use the given file as a history file. With a history file, you can browse58 previously selected values with the up/down arrow keys.60 .B \-y61 .B \--yes62 Quickpick between "y" and "n" with "[Y/n]" appended to the prompt, exiting with63 success if "n" is not chosen.65 .B \-n66 .B \--no67 Quickpick between "y" and "n" with "[y/N]" appended to the prompt, exiting with68 failure if "y" is not chosen.70 .B options...71 If additional command line arguments are provided, or if any input is piped in,72 \fBask\fR will operate in fuzzy finding mode, attempting to pick one of the73 given options.75 .SH EXAMPLES76 .TP77 .B78 foo="`ask 'What is foo? '`"79 Store user input in a variable. (Equivalent of \fBread -p 'What is foo? ' foo\fR)81 .TP82 .B83 rm "`ls | ask 'Delete file: '`"84 Fuzzy find a file. (Equivalent of \fBrm "`ls | fzf --prompt='Delete file: '`"\fR)86 .TP87 .B88 if ask -y 'Do thing? '; then dothing; fi89 Ask user for confirmation (default: yes).91 .SH AUTHOR92 Bruce Hill (bruce@bruce-hill.com)