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.3.0"></a>
## [v1.3.0] - 2022-10-08
### Code Refactoring
- refactor change func name FlagOutput() to Output()
<a name="v1.2.3"></a>
## [v1.2.3] - 2022-10-07
### Changes
......@@ -40,6 +46,7 @@
<a name="v1.0.0"></a>
## v1.0.0 - 2022-10-04
[v1.3.0]: https://gitlab.schukai.com/oss/libraries/go/application/xflags/compare/v1.2.3...v1.3.0
[v1.2.3]: https://gitlab.schukai.com/oss/libraries/go/application/xflags/compare/v1.2.2...v1.2.3
[v1.2.2]: https://gitlab.schukai.com/oss/libraries/go/application/xflags/compare/v1.2.1...v1.2.2
[v1.2.1]: https://gitlab.schukai.com/oss/libraries/go/application/xflags/compare/v1.2.0...v1.2.1
......
......@@ -79,6 +79,9 @@ the command `serve`. Furthermore, the command has the tag `call` with
the value `DoServe`. The function `DoServe` is called when the command
`serve` is used.
Important: The function must be exported, that means it
must start with a capital letter.
The function is called with the receiver `*Definition`
An example for the function `DoServe`:
......
......@@ -34,8 +34,8 @@ func New[C any](name string, definitions C) *Settings[C] {
return s
}
// FlagOutput returns the writer where the flag package writes its output.
func (s *Settings[C]) FlagOutput() string {
// Output returns the writer where the flag package writes its output.
func (s *Settings[C]) Output() string {
return s.flagOutput.(*bytes.Buffer).String()
}
......
......@@ -8,6 +8,23 @@ import (
"testing"
)
func TestUsage(t *testing.T) {
commands := New("root", CmdTest1{})
args := []string{"-h"}
commands.Parse(args)
assert.False(t, commands.HasErrors())
if commands.HasErrors() {
t.Log(commands.Errors())
}
usage := commands.Usage()
assert.NotEmpty(t, usage)
}
func TestNewIntWithError(t *testing.T) {
// two is not a struct
......
{"version":"1.2.3"}
{"version":"1.3.0"}