Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • v1.0.0
  • v1.1.0
  • v1.1.1
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.11.0
  • v1.12.0
  • v1.13.0
  • v1.13.1
  • v1.13.2
  • v1.14.0
  • v1.15.0
  • v1.16.0
  • v1.16.1
  • v1.16.2
  • v1.16.3
  • v1.16.4
  • v1.16.5
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.3.0
  • v1.3.1
  • v1.4.0
  • v1.5.0
  • v1.6.0
  • v1.7.0
  • v1.8.0
  • v1.8.1
  • v1.8.2
  • v1.8.3
  • v1.9.0
35 results

Target

Select target project
  • oss/libraries/go/application/xflags
1 result
Select Git revision
  • master
  • v1.0.0
  • v1.1.0
  • v1.1.1
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.11.0
  • v1.12.0
  • v1.13.0
  • v1.13.1
  • v1.13.2
  • v1.14.0
  • v1.15.0
  • v1.16.0
  • v1.16.1
  • v1.16.2
  • v1.16.3
  • v1.16.4
  • v1.16.5
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.3.0
  • v1.3.1
  • v1.4.0
  • v1.5.0
  • v1.6.0
  • v1.7.0
  • v1.8.0
  • v1.8.1
  • v1.8.2
  • v1.8.3
  • v1.9.0
35 results
Show changes
Commits on Source (3)
<a name="v1.12.0"></a>
## [v1.12.0] - 2022-10-19
### Bug Fixes
- fix remove tag for command [#4](https://gitlab.schukai.com/oss/libraries/go/application/xflags/issues/4)
<a name="v1.11.0"></a>
## [v1.11.0] - 2022-10-19
### Add Features
......@@ -135,6 +141,7 @@
<a name="v1.0.0"></a>
## v1.0.0 - 2022-10-04
[v1.12.0]: https://gitlab.schukai.com/oss/libraries/go/application/xflags/compare/v1.11.0...v1.12.0
[v1.11.0]: https://gitlab.schukai.com/oss/libraries/go/application/xflags/compare/v1.10.2...v1.11.0
[v1.10.2]: https://gitlab.schukai.com/oss/libraries/go/application/xflags/compare/v1.10.1...v1.10.2
[v1.10.1]: https://gitlab.schukai.com/oss/libraries/go/application/xflags/compare/v1.10.0...v1.10.1
......
......@@ -163,7 +163,7 @@ func (c *cmd[C]) parseStruct(dta any) {
}
c.initFlags(x, m)
} else if m[tagCommand] != "" {
c.tagMapping[m[tagCommand]] = v.Type().Field(i).Name
//c.tagMapping["cmd"+m[tagCommand]] = v.Type().Field(i).Name
c.initCommands(x, m, v.Type().Field(i).Name)
} else if m[tagIgnore] != "" {
......
......@@ -2,12 +2,14 @@ module gitlab.schukai.com/oss/libraries/go/application/xflags
go 1.19
require github.com/stretchr/testify v1.8.0
require (
github.com/stretchr/testify v1.8.0
gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.3.1
)
require (
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.3.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
// Copyright 2022 schukai GmbH
// SPDX-License-Identifier: AGPL-3.0
package xflags
import (
"github.com/stretchr/testify/assert"
"testing"
)
type testConfigCommandIssue4 struct {
}
type testCmdStructIssue4 struct {
ConfigPath string `long:"config" short:"c" description:"Path to configuration file"`
Config testConfigCommandIssue4 `command:"config" description:"Config commands"`
}
// TestIssue4 tests the issue #4.
func TestIssue4B(t *testing.T) {
s := New("test", testCmdStructIssue4{})
s.Parse([]string{"--config", "config"})
assert.Equal(t, s.HasErrors(), false)
if s.HasErrors() {
t.Log(s.Errors())
}
}
{"version":"1.11.0"}
{"version":"1.12.0"}
......@@ -24,5 +24,5 @@ func TestInitCommands(t *testing.T) {
assert.Equal(t, 0, len(s.errors))
assert.Equal(t, "test", s.command.name)
assert.Equal(t, 1, len(s.command.commands))
assert.Equal(t, 3, len(s.command.tagMapping))
assert.Equal(t, 2, len(s.command.tagMapping))
}