Compare commits

...

6 Commits
v0.4.0 ... main

Author SHA1 Message Date
github-actions[bot]
6965b03ae5 chore: auto-update Go modules 2025-04-07 00:03:31 +00:00
09e4b107bf -log-level flag now -loglevel
Some checks failed
CI / Lint (push) Has been cancelled
Auto-Update Go Modules / update-go-modules (push) Has been cancelled
upd README, CHANGELOG
2025-04-05 22:15:29 +01:00
c7b9d75ea1 reword
Some checks failed
CI / Lint (push) Has been cancelled
2025-04-04 05:50:32 +01:00
cc42e928e0 upd tested against 2025-04-04 05:45:24 +01:00
80a675cc6a add/fix dates 2025-04-04 05:39:45 +01:00
6801d9e4e1 upd CHANGELOG 2025-04-04 05:38:46 +01:00
5 changed files with 28 additions and 28 deletions

View File

@ -11,6 +11,19 @@ Before any major/minor/patch bump all unit tests will be run to verify they pass
- [x]
# [0.4.1] - 2025-04-05
### Changed
- `-loglevel` flag is now of type string. It accepts any one of trace, debug, info, warn, error, fatal or panic.
- It defaults to warn.
# [0.3.1] - 2025-03-31
### Fixed
- The CLI now uses `os.UserConfigDir()` to load the default *config.toml*, which should respect `$XDG_CONFIG_HOME`. See [UserConfigDir](https://pkg.go.dev/os#UserConfigDir)
# [0.2.1] - 2024-11-07
### Fixed

View File

@ -9,10 +9,10 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
## Tested against
- Basic 1.0.8.4
- Banana 2.0.6.4
- Potato 3.0.2.4
- Matrix 1.0.0.3
- Basic 1.1.1.8
- Banana 2.1.1.8
- Potato 3.1.1.8
- Matrix 1.0.1.2
## Requirements
@ -84,7 +84,7 @@ Command line flags will override values in a config.toml.
## `Script files`
The vbantxt-cli utility accepts a single string request or an array of string requests. This means you can pass scripts stored in files.
The vbantxt CLI accepts a single string request or an array of string requests. This means you can pass scripts stored in files.
For example, in Windows with Powershell you could:
@ -116,7 +116,7 @@ vbantxt -s=streamname "Point(ASIO128.IN[2],ASIO128.OUT[1]).dBGain = -8"
## `Logging`
The `-log-level` flag allows you to control the verbosity of the application's logging output.
The `-loglevel` flag allows you to control the verbosity of the application's logging output.
Acceptable values for this flag are:
@ -131,7 +131,7 @@ Acceptable values for this flag are:
For example, to set the log level to `debug`, you can use:
```
vbantxt -s=streamname -log-level=debug "bus[0].eq.on=1 bus[1].gain=-12.8"
vbantxt -s=streamname -loglevel=debug "bus[0].eq.on=1 bus[1].gain=-12.8"
```
The default log level is `warn` if the flag is not specified.

View File

@ -23,7 +23,7 @@ type opts struct {
}
func exit(err error) {
_, _ = fmt.Fprintf(os.Stderr, "Error: %s", err)
_, _ = fmt.Fprintf(os.Stderr, "Error: %s\n", err)
os.Exit(1)
}
@ -60,29 +60,16 @@ func main() {
defaultConfigPath := filepath.Join(configDir, "vbantxt", "config.toml")
flag.StringVar(&configPath, "config", defaultConfigPath, "config path")
flag.StringVar(&configPath, "C", defaultConfigPath, "config path (shorthand)")
flag.StringVar(&loglevel, "log-level", "warn", "log level")
flag.StringVar(&loglevel, "loglevel", "warn", "log level")
flag.StringVar(&loglevel, "l", "warn", "log level (shorthand)")
flag.Parse()
switch loglevel {
case "trace":
log.SetLevel(log.TraceLevel)
case "debug":
log.SetLevel(log.DebugLevel)
case "info":
log.SetLevel(log.InfoLevel)
case "warn":
log.SetLevel(log.WarnLevel)
case "error":
log.SetLevel(log.ErrorLevel)
case "fatal":
log.SetLevel(log.FatalLevel)
case "panic":
log.SetLevel(log.PanicLevel)
default:
level, err := log.ParseLevel(loglevel)
if err != nil {
exit(fmt.Errorf("invalid log level: %s", loglevel))
}
log.SetLevel(level)
o := opts{
host: host,

2
go.mod
View File

@ -13,6 +13,6 @@ require (
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/sys v0.32.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

4
go.sum
View File

@ -12,8 +12,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=