mirror of
https://codeberg.org/scip/rpnc.git
synced 2025-12-16 20:11:02 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 433c5ede91 | |||
|
|
b77ef061e6 | ||
|
|
2a5e70279e | ||
|
|
6c56ed9508 | ||
| ff76137986 | |||
| e5dfad1e35 |
32
.github/workflows/release.yaml
vendored
Normal file
32
.github/workflows/release.yaml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: build-and-test
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Build Release Assets
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22.11
|
||||
|
||||
- name: Build the executables
|
||||
run: ./mkrel.sh rpnc ${{ github.ref_name}}
|
||||
|
||||
- name: List the executables
|
||||
run: ls -l ./releases
|
||||
|
||||
- name: Upload the binaries
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag: ${{ github.ref_name }}
|
||||
file: ./releases/*
|
||||
file_glob: true
|
||||
4
Makefile
4
Makefile
@@ -81,8 +81,8 @@ goupdate:
|
||||
buildall:
|
||||
./mkrel.sh $(tool) $(VERSION)
|
||||
|
||||
release: buildall
|
||||
gh release create v$(VERSION) --generate-notes releases/*
|
||||
release:
|
||||
gh release create v$(VERSION) --generate-notes
|
||||
|
||||
show-versions: buildlocal
|
||||
@echo "### rpn version:"
|
||||
|
||||
4
calc.go
4
calc.go
@@ -370,9 +370,7 @@ func (c *Calc) EvalItem(item string) error {
|
||||
}
|
||||
|
||||
switch item {
|
||||
case "?":
|
||||
fallthrough
|
||||
case "help":
|
||||
case "?", "help":
|
||||
c.PrintHelp()
|
||||
|
||||
default:
|
||||
|
||||
2
go.mod
2
go.mod
@@ -5,7 +5,7 @@ go 1.22
|
||||
require (
|
||||
github.com/chzyer/readline v1.5.1
|
||||
github.com/rogpeppe/go-internal v1.13.1
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/spf13/pflag v1.0.6
|
||||
github.com/yuin/gopher-lua v1.1.1
|
||||
)
|
||||
|
||||
|
||||
4
go.sum
4
go.sum
@@ -6,8 +6,8 @@ github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04=
|
||||
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
|
||||
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
|
||||
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
|
||||
github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
|
||||
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
|
||||
@@ -116,9 +116,7 @@ func (i *Interpreter) CallLuaFunc(funcname string, items []float64) (float64, er
|
||||
funcname, LuaFuncs[funcname].numargs))
|
||||
|
||||
switch LuaFuncs[funcname].numargs {
|
||||
case 0:
|
||||
fallthrough
|
||||
case 1:
|
||||
case 0, 1:
|
||||
// 1 arg variant
|
||||
if err := LuaInterpreter.CallByParam(lua.P{
|
||||
Fn: LuaInterpreter.GetGlobal(funcname),
|
||||
|
||||
4
main.go
4
main.go
@@ -30,7 +30,7 @@ import (
|
||||
lua "github.com/yuin/gopher-lua"
|
||||
)
|
||||
|
||||
const VERSION string = "2.1.3"
|
||||
const VERSION string = "2.1.4"
|
||||
|
||||
const Usage string = `This is rpn, a reverse polish notation calculator cli.
|
||||
|
||||
@@ -50,7 +50,7 @@ Options:
|
||||
When <operator> is given, batch mode ist automatically enabled. Use
|
||||
this only when working with stdin. E.g.: echo "2 3 4 5" | rpn +
|
||||
|
||||
Copyright (c) 2023-2024 T.v.Dein`
|
||||
Copyright (c) 2023-2025 T.v.Dein`
|
||||
|
||||
func main() {
|
||||
os.Exit(Main())
|
||||
|
||||
Reference in New Issue
Block a user