suppress intermediate results unless -i, addresses #11, fix man (#13)

This commit is contained in:
T.v.Dein
2023-11-08 14:43:34 +01:00
committed by GitHub
parent 64e66e9d7b
commit fa5f8dcb3b
4 changed files with 56 additions and 23 deletions

22
rpn.go
View File

@@ -2,16 +2,19 @@ package main
var manpage = `
NAME
rpn - Reverse Polish Notation Calculator for the commandline
rpn - Programmable command-line calculator using reverse polish notation
SYNOPSIS
Usage: rpn [-bdvh] [<operator>]
Options:
-b, --batchmode enable batch mode
-d, --debug enable debug mode
-v, --version show version
-h, --help show help
-b, --batchmode enable batch mode
-d, --debug enable debug mode
-s, --stack show last 5 items of the stack (off by default)
-i --intermediate print intermediate results
-m, --manual show manual
-v, --version show version
-h, --help show help
When <operator> is given, batch mode ist automatically enabled. Use
this only when working with stdin. E.g.: echo "2 3 4 5" | rpn +
@@ -193,6 +196,15 @@ INTERACTIVE REPL
ctrl-r
Search through history.
COMMENTS
Lines starting with "#" are being ignored as comments. You can also
append comments to rpn input, e.g.:
# a comment
123 # another comment
In this case only 123 will be added to the stack.
EXTENDING RPN USING LUA
You can use a lua script with lua functions to extend the calculator. By
default the tool looks for "~/.rpn.lua". You can also specify a script