Added manpage
This commit is contained in:
parent
904af4e28d
commit
64aaffb068
68
ask.1
Normal file
68
ask.1
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user