aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2023-02-03 17:43:45 -0330
committerSam Anthony <sam@samanthony.xyz>2023-02-03 17:43:45 -0330
commit2ae82d57c87a7a46fcf38ed4c7803fbb5472f5ce (patch)
tree26851c6f54dca21a655abd04b06ab0beceb62abe
parent0f6e1d41b37284dfcea5744ce81e78710b5a867c (diff)
downloadpfc-2ae82d57c87a7a46fcf38ed4c7803fbb5472f5ce.zip
add man pagev0.3.1
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--Makefile29
-rw-r--r--config.mk4
-rw-r--r--pfc.152
5 files changed, 78 insertions, 11 deletions
diff --git a/Cargo.lock b/Cargo.lock
index c29344c..e5718f6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -113,7 +113,7 @@ dependencies = [
[[package]]
name = "pfc"
-version = "0.3.0"
+version = "0.3.1"
dependencies = [
"crossterm",
"tui",
diff --git a/Cargo.toml b/Cargo.toml
index 2637d53..386dd1a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "pfc"
-version = "0.3.0"
+version = "0.3.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/Makefile b/Makefile
index 92bb2bc..c6695e2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,29 @@
-build: test format
+include config.mk
+
+build:
+ cargo fmt --all
+ cargo test
cargo build
run: build
- ./target/debug/pfc
+ target/debug/pfc
-doc: test format
+doc:
cargo doc --open
-test: format
- cargo test
-
-format:
- cargo fmt --all
+clean:
+ rm -r target
install:
cargo build --release
- cp ./target/release/pfc ~/.local/bin/
+ cp target/release/pfc ${DESTDIR}${PREFIX}/bin
+ chmod 755 ${DESTDIR}${PREFIX}/bin/pfc
+ mkdir -p ${DESTDIR}${MANPREFIX}/man1
+ sed "s/VERSION/${VERSION}/g" < pfc.1 > ${DESTDIR}${MANPREFIX}/man1/pfc.1
+ chmod 644 ${DESTDIR}${MANPREFIX}/man1/pfc.1
+
+uninstall:
+ rm -f ${DESTDIR}${PREFIX}/bin/pfc\
+ ${DESTDIR}${MANPREFIX}/man1/pfc.1
+
+.PHONY: build run doc clean install uninstall
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..c545550
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,4 @@
+VERSION = 0.3
+
+PREFIX = /usr/local
+MANPREFIX = ${PREFIX}/share/man
diff --git a/pfc.1 b/pfc.1
new file mode 100644
index 0000000..28e4d5c
--- /dev/null
+++ b/pfc.1
@@ -0,0 +1,52 @@
+.TH PFC 1 pfc\-VERSION
+.SH NAME
+pfc \- postfix calculator
+.SH SYNOPSIS
+.B pfc
+.SH DESCRIPTION
+pfc is an interactive postfix, or reverse Polish notation, calculator.
+.SH USAGE
+.SS Keyboard commands
+.TP
+.B q
+Quit.
+.TP
+.B [0..9]
+Enter a digit into the input buffer.
+pfc works with floating point numbers so the
+.B .
+character is OK as well.
+.TP
+.B Backspace
+Remove a digit from the input buffer.
+.TP
+.B Enter
+Push the number in the input buffer to the stack.
+.TP
+.B j
+Swap the bottom (most recently pushed) item on the stack with the input buffer.
+If the input buffer is empty this simply moves the most recently pushed item
+back into the input buffer.
+.TP
+.B k
+The same as
+.BR j .
+.TP
+.B d
+Delete the contents of the input buffer.
+.SS Operators
+.TP
+.B +
+Addition.
+.TP
+.B -
+Subtraction.
+.TP
+.B *
+Multiplication.
+.TP
+.B /
+Division.
+.TP
+.B ^
+Exponentiation.