mirror of
https://codeberg.org/scip/rpnc.git
synced 2025-12-17 04:21:01 +01:00
Compare commits
5 Commits
doc/fix-fo
...
fix/dont-s
| Author | SHA1 | Date | |
|---|---|---|---|
| 28abd79961 | |||
| dd14e7ec35 | |||
|
|
d2db420837 | ||
|
|
b4f53d2dd6 | ||
| ec4d86f727 |
20
calc.go
20
calc.go
@@ -121,19 +121,27 @@ func (c *Calc) GetCompleteCustomFuncalls() func(string) []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for command := range c.SettingsCommands {
|
for command := range c.SettingsCommands {
|
||||||
completions = append(completions, command)
|
if len(command) > 1 {
|
||||||
|
completions = append(completions, command)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for command := range c.ShowCommands {
|
for command := range c.ShowCommands {
|
||||||
completions = append(completions, command)
|
if len(command) > 1 {
|
||||||
|
completions = append(completions, command)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for command := range c.StackCommands {
|
for command := range c.StackCommands {
|
||||||
completions = append(completions, command)
|
if len(command) > 1 {
|
||||||
|
completions = append(completions, command)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for command := range c.Commands {
|
for command := range c.Commands {
|
||||||
completions = append(completions, command)
|
if len(command) > 1 {
|
||||||
|
completions = append(completions, command)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return completions
|
return completions
|
||||||
@@ -512,7 +520,9 @@ func sortcommands(hash Commands) []string {
|
|||||||
keys := make([]string, 0, len(hash))
|
keys := make([]string, 0, len(hash))
|
||||||
|
|
||||||
for key := range hash {
|
for key := range hash {
|
||||||
keys = append(keys, key)
|
if len(key) > 1 {
|
||||||
|
keys = append(keys, key)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sort.Strings(keys)
|
sort.Strings(keys)
|
||||||
|
|||||||
13
command.go
13
command.go
@@ -305,6 +305,15 @@ func (c *Calc) SetCommands() {
|
|||||||
|
|
||||||
// aliases
|
// aliases
|
||||||
c.Commands["quit"] = c.Commands["exit"]
|
c.Commands["quit"] = c.Commands["exit"]
|
||||||
c.SettingsCommands["undebug"] = c.SettingsCommands["nodebug"]
|
|
||||||
c.SettingsCommands["show"] = c.SettingsCommands["showstack"]
|
c.SettingsCommands["d"] = c.SettingsCommands["debug"]
|
||||||
|
c.SettingsCommands["b"] = c.SettingsCommands["batch"]
|
||||||
|
c.SettingsCommands["s"] = c.SettingsCommands["showstack"]
|
||||||
|
|
||||||
|
c.ShowCommands["h"] = c.ShowCommands["history"]
|
||||||
|
c.ShowCommands["p"] = c.ShowCommands["dump"]
|
||||||
|
c.ShowCommands["v"] = c.ShowCommands["vars"]
|
||||||
|
|
||||||
|
c.StackCommands["c"] = c.StackCommands["clear"]
|
||||||
|
c.StackCommands["u"] = c.StackCommands["undo"]
|
||||||
}
|
}
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -30,7 +30,7 @@ import (
|
|||||||
lua "github.com/yuin/gopher-lua"
|
lua "github.com/yuin/gopher-lua"
|
||||||
)
|
)
|
||||||
|
|
||||||
const VERSION string = "2.0.11"
|
const VERSION string = "2.0.12"
|
||||||
|
|
||||||
const Usage string = `This is rpn, a reverse polish notation calculator cli.
|
const Usage string = `This is rpn, a reverse polish notation calculator cli.
|
||||||
|
|
||||||
|
|||||||
11
rpn.go
11
rpn.go
@@ -208,6 +208,17 @@ DESCRIPTION
|
|||||||
|
|
||||||
Refer to https://pkg.go.dev/math for details about those functions.
|
Refer to https://pkg.go.dev/math for details about those functions.
|
||||||
|
|
||||||
|
There are also a number of shortcuts for some commands available:
|
||||||
|
|
||||||
|
d debug
|
||||||
|
b batch
|
||||||
|
s showstack
|
||||||
|
h history
|
||||||
|
p dump (aka print)
|
||||||
|
v vars
|
||||||
|
c clear
|
||||||
|
u undo
|
||||||
|
|
||||||
INTERACTIVE REPL
|
INTERACTIVE REPL
|
||||||
While you can use rpn in the command-line, the best experience you'll
|
While you can use rpn in the command-line, the best experience you'll
|
||||||
have is the interactive repl (read eval print loop). Just execute "rpn"
|
have is the interactive repl (read eval print loop). Just execute "rpn"
|
||||||
|
|||||||
11
rpn.pod
11
rpn.pod
@@ -216,6 +216,17 @@ Register variables:
|
|||||||
|
|
||||||
Refer to https://pkg.go.dev/math for details about those functions.
|
Refer to https://pkg.go.dev/math for details about those functions.
|
||||||
|
|
||||||
|
There are also a number of shortcuts for some commands available:
|
||||||
|
|
||||||
|
d debug
|
||||||
|
b batch
|
||||||
|
s showstack
|
||||||
|
h history
|
||||||
|
p dump (aka print)
|
||||||
|
v vars
|
||||||
|
c clear
|
||||||
|
u undo
|
||||||
|
|
||||||
=head1 INTERACTIVE REPL
|
=head1 INTERACTIVE REPL
|
||||||
|
|
||||||
While you can use rpn in the command-line, the best experience you'll
|
While you can use rpn in the command-line, the best experience you'll
|
||||||
|
|||||||
Reference in New Issue
Block a user