Browse Source

usage and man page updated

main
Blau Araujo 1 year ago
parent
commit
175d7392e4
  1. 34
      cawk
  2. 36
      cawk.1

34
cawk

@ -33,32 +33,36 @@ error[0]="Exiting..."
error[1]="Invalid expression!"
error[2]="Invalid argument!"
bold=$'\e[1m'
reset=$'\e[m'
copy='Copyright (C) 2022 Blau Araujo <blau@debxp.org>.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
License: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
'
help="cawk ($version) - REPL calculator in Bash and AWK
help="${bold}cawk${reset} ($version) - REPL calculator in Bash and AWK
USAGE
${bold}USAGE${reset}
cawk [-f PRECISION] - Start in REPL mode.
cawk -e EXPRESSION [-f PRECISION] - Eval EXPRESSION and quit.
COMMAND | cawk [-f PRECISION] - Eval expressions from COMMAND output.
cawk [-f PRECISION] < FILE - Eval expressions list in FILE
${bold}cawk${reset} [-f PRECISION]
${bold}cawk${reset} -e EXPRESSION [-f PRECISION]
COMMAND | ${bold}cawk${reset} [-f PRECISION]
${bold}cawk${reset} [-f PRECISION] < FILE
OPTIONS
${bold}OPTIONS${reset}
-e EXPRESSION Expression to evaluate.
-f PRECISION Number of positions after decimal point.
${bold}-e${reset} EXPRESSION Expression to evaluate.
${bold}-f${reset} PRECISION Number of positions after decimal point.
${bold}-h${reset} or ${bold}--help${reset} This help.
COMMANDS
${bold}COMMANDS${reset}
f PRECISION Redefine precision.
h or ? Help.
q or quit Quit.
${bold}f${reset} PRECISION Redefine precision.
${bold}h${reset} or ${bold}?${reset} Help.
${bold}q${reset} or ${bold}quit${reset} Quit.
"
# functions -------------------------------------------------------------------
@ -87,7 +91,7 @@ repl() {
case "${REPLY,,}" in
f*( )+([0-9])) PRECISION=${REPLY:1}
;;
h|'?') echo "$help"
help|h|'?') echo "$help"
;;
q|quit) die 0
;;

36
cawk.1

@ -2,7 +2,7 @@
.\" Text automatically generated by txt2man
.RS
.SH NAME
\fBcawk \fP- REPL calculator in Bash and GNU awk.
\fBcawk\fP - REPL calculator in Bash and GNU awk.
.SH SYNOPSIS
.nf
.fam C
@ -15,31 +15,35 @@
.fam T
.fi
.SH DESCRIPTION
When executed whith no arguments, or just with the optional \fB-f\fP PRECISION, \fBcawk\fP enter in REPL mode (\fBR\fPead \fBE\fPval \fBP\fPrint \fBL\fPoop). With \fB-e\fP option, EXPRESSION is evaluated and \fBcawk\fP exits. Expressions lists can also be passed by pipe, here strings, or files (via shell redirection for reading).
When executed whith no arguments, or just with the optional \fB-f\fP PRECISION,
\fBcawk\fP enter in REPL mode (\fBR\fPead \fBE\fPval \fBP\fPrint \fBL\fPoop).
With \fB-e\fP option, EXPRESSION is evaluated and \fBcawk\fP exits. Expressions
lists can also be passed by pipe, here strings, or files (via shell redirection
for reading).
.SH OPTIONS
.TP
\fB-e EXPRESSION\fP
.TP 18
\fB-e\fP EXPRESSION
Expression to evaluate.
.TP
\fB-f PRECISION\fP
\fB-f\fP PRECISION
Number of positions after decimal point.
.SH COMMANDS (REPL mode)
.TP
\fBf NUMBER\fP
\fB-h\fP or \fB--help\fP
This help.
.SH COMMANDS
.TP 18
\fBf\fP PRECISION
Redefine precision.
.TP
\fBh\fP or \fB?\fP
\fBhelp\fP, \fBh\fP or \fB?\fP
Help.
.TP
\fBq\fP or \fBquit\fP
Exit.
.SH SEE ALSO
<https://git.blauaraujo.com/blau_araujo/cawk>
.SH REPORTING BUGS
https://git.blauaraujo.com/blau_araujo/cawk/issues
<https://git.blauaraujo.com/blau_araujo/cawk/issues>
.SH AUTHORS
Written by Blau Araujo <blau@debxp.org>
.SH COPYRIGHT
@ -47,5 +51,5 @@ Copyright©2022, Blau Araujo.
.PP
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
.PP
This is free software: you are free to change and redistribute it. There is NO
WARRANTY, to the extent permitted by law.
This is free software: you are free to change and redistribute it. There is NO WARRANTY,
to the extent permitted by law.

Loading…
Cancel
Save