Browse Source

man page and makefile

main
Blau Araujo 11 months ago
parent
commit
30d5d87710
  1. 15
      Makefile
  2. 58
      README.md
  3. 51
      cawk.1

15
Makefile

@ -0,0 +1,15 @@
PREFIX ?= /usr
MANDIR ?= $(PREFIX)/share/man
all:
echo Run \'make install\' to install cawk.
install:
mkdir -p $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp -p cawk $(DESTDIR)$(PREFIX)/bin/cawk
cp -p cawk.1 $(DESTDIR)$(MANDIR)/man1
uninstall:
rm -rf $(DESTDIR)$(PREFIX)/bin/cawk
rm -rf $(DESTDIR)$(MANDIR)/man1/cawk.1*

58
README.md

@ -1,20 +1,54 @@
# cawk
REPL calculator in Bash and AWK
REPL calculator in Bash and GNU awk
## Usage
```
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
```
### Options
```
-e EXPRESSION Expression to evaluate.
-f PRECISION Number of positions after decimal point.
```
### Commands (in REPL mode)
```
f PRECISION Redefine precision.
h or ? Help.
q or quit Exit.
```
## Depends
- Bash 5+
- GNU awk
## Install
Clone this repository:
```
:~$ git clone https://git.blauaraujo.com/blau_araujo/cawk.git
```
USAGE
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.
OPTIONS
-e EXPRESSION Expression to evaluate.
-f PRECISION Number of positions after decimal point.
As root, enter `cawk` directory and run:
COMMANDS
f[0-9] Redefine precision.
h|? Help.
q|quit Quit.
```
make install
```
## Uninstall
As root, enter `cawk` directory and run:
```
make uninstall
```

51
cawk.1

@ -0,0 +1,51 @@
.TH CAWK "1" "Mar 2022" "CAWK 0.0.1" "REPL calculator in Bash and GNU awk"
.\" Text automatically generated by txt2man
.RS
.SH NAME
\fBcawk \fP- REPL calculator in Bash and GNU awk.
.SH SYNOPSIS
.nf
.fam C
\fBcawk\fP [-f PRECISION]
\fBcawk\fP -e EXPRESSION [-f PRECISION]
COMMAND | \fBcawk\fP [-f PRECISION]
\fBcawk\fP [-f PRECISION] < FILE
.fam T
.fi
.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).
.SH OPTIONS
.TP
\fB-e EXPRESSION\fP
Expression to evaluate.
.TP
\fB-f PRECISION\fP
Number of positions after decimal point.
.SH COMMANDS (REPL mode)
.TP
\fBf NUMBER\fP
Redefine precision.
.TP
\fBh\fP or \fB?\fP
Help.
.TP
\fBq\fP or \fBquit\fP
Exit.
.SH REPORTING BUGS
https://git.blauaraujo.com/blau_araujo/cawk/issues
.SH AUTHORS
Written by Blau Araujo <blau@debxp.org>
.SH COPYRIGHT
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.
Loading…
Cancel
Save