mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-12 06:24:10 +01:00
cmd: make "akvorado version" shorter
This commit is contained in:
@@ -36,6 +36,9 @@ var versionCmd = &cobra.Command{
|
||||
}
|
||||
}
|
||||
}
|
||||
if !debug {
|
||||
return nil
|
||||
}
|
||||
cmd.Println()
|
||||
|
||||
sch, err := schema.New(schema.DefaultConfiguration())
|
||||
|
||||
@@ -41,4 +41,21 @@ func TestVersion(t *testing.T) {
|
||||
if diff := helpers.Diff(got[:len(want)], want); diff != "" {
|
||||
t.Errorf("`version` (-got, +want):\n%s", diff)
|
||||
}
|
||||
if strings.Contains(buf.String(), "\n- SrcNetName\n") {
|
||||
t.Errorf("`version` contains %q", "SrcNetName")
|
||||
}
|
||||
}
|
||||
|
||||
func TestVersionDebug(t *testing.T) {
|
||||
root := cmd.RootCmd
|
||||
buf := new(bytes.Buffer)
|
||||
root.SetOut(buf)
|
||||
root.SetArgs([]string{"version", "-d"})
|
||||
err := root.Execute()
|
||||
if err != nil {
|
||||
t.Errorf("`version` error:\n%+v", err)
|
||||
}
|
||||
if !strings.Contains(buf.String(), "\n- SrcNetName\n") {
|
||||
t.Errorf("`version` does NOT contain %q", "SrcNetName")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ identified with a specific icon:
|
||||
## Unreleased
|
||||
|
||||
- 🌱 *console*: submit form on Ctrl-Enter or Cmd-Enter while selecting dimensions
|
||||
- 🌱 *cmd*: make `akvorado version` shorter (use `-d` for full output)
|
||||
- 🌱 *build*: modernize JavaScript build with Oxlint and Rolldown-Vite
|
||||
|
||||
## 2.0.0-beta.6 - 2025-09-06
|
||||
|
||||
Reference in New Issue
Block a user