mirror of
https://github.com/onyx-and-iris/vbantxt.git
synced 2025-04-28 17:03:52 +01:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6965b03ae5 | ||
09e4b107bf | |||
c7b9d75ea1 | |||
cc42e928e0 | |||
80a675cc6a | |||
6801d9e4e1 |
13
CHANGELOG.md
13
CHANGELOG.md
@ -11,6 +11,19 @@ Before any major/minor/patch bump all unit tests will be run to verify they pass
|
|||||||
|
|
||||||
- [x]
|
- [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
|
# [0.2.1] - 2024-11-07
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
14
README.md
14
README.md
@ -9,10 +9,10 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
|
|||||||
|
|
||||||
## Tested against
|
## Tested against
|
||||||
|
|
||||||
- Basic 1.0.8.4
|
- Basic 1.1.1.8
|
||||||
- Banana 2.0.6.4
|
- Banana 2.1.1.8
|
||||||
- Potato 3.0.2.4
|
- Potato 3.1.1.8
|
||||||
- Matrix 1.0.0.3
|
- Matrix 1.0.1.2
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ Command line flags will override values in a config.toml.
|
|||||||
|
|
||||||
## `Script files`
|
## `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:
|
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`
|
## `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:
|
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:
|
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.
|
The default log level is `warn` if the flag is not specified.
|
||||||
|
@ -23,7 +23,7 @@ type opts struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func exit(err error) {
|
func exit(err error) {
|
||||||
_, _ = fmt.Fprintf(os.Stderr, "Error: %s", err)
|
_, _ = fmt.Fprintf(os.Stderr, "Error: %s\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,29 +60,16 @@ func main() {
|
|||||||
defaultConfigPath := filepath.Join(configDir, "vbantxt", "config.toml")
|
defaultConfigPath := filepath.Join(configDir, "vbantxt", "config.toml")
|
||||||
flag.StringVar(&configPath, "config", defaultConfigPath, "config path")
|
flag.StringVar(&configPath, "config", defaultConfigPath, "config path")
|
||||||
flag.StringVar(&configPath, "C", defaultConfigPath, "config path (shorthand)")
|
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.StringVar(&loglevel, "l", "warn", "log level (shorthand)")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
switch loglevel {
|
level, err := log.ParseLevel(loglevel)
|
||||||
case "trace":
|
if err != nil {
|
||||||
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:
|
|
||||||
exit(fmt.Errorf("invalid log level: %s", loglevel))
|
exit(fmt.Errorf("invalid log level: %s", loglevel))
|
||||||
}
|
}
|
||||||
|
log.SetLevel(level)
|
||||||
|
|
||||||
o := opts{
|
o := opts{
|
||||||
host: host,
|
host: host,
|
||||||
|
2
go.mod
2
go.mod
@ -13,6 +13,6 @@ require (
|
|||||||
require (
|
require (
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // 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
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
4
go.sum
4
go.sum
@ -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 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
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.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
|
||||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
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 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
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=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user