Feature/add show stack (#5)

* add -s flag and show command to display the last 5 entries
This commit is contained in:
T.v.Dein
2023-11-06 20:12:07 +01:00
committed by GitHub
parent 9441be35ef
commit bb49cb7626
2 changed files with 24 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ Usage: rpn [-bdvh] [<operator>]
Options:
-b, --batchmode enable batch mode
-d, --debug enable debug mode
-s, --stack show last 5 items of the stack (off by default)
-m, --manual show manual
-v, --version show version
-h, --help show help
@@ -58,6 +59,7 @@ func main() {
configfile := ""
flag.BoolVarP(&calc.batch, "batchmode", "b", false, "batch mode")
flag.BoolVarP(&calc.showstack, "showstack", "s", false, "show stack")
flag.BoolVarP(&enabledebug, "debug", "d", false, "debug mode")
flag.BoolVarP(&showversion, "version", "v", false, "show version")
flag.BoolVarP(&showhelp, "help", "h", false, "show usage")