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 (4)
...@@ -2,7 +2,7 @@ style: gitlab ...@@ -2,7 +2,7 @@ style: gitlab
template: CHANGELOG.tpl.md template: CHANGELOG.tpl.md
info: info:
title: CHANGELOG title: CHANGELOG
repository_url: https://gitlab.schukai.com/oss/libraries/go/application/configuration repository_url: https://gitlab.schukai.com/oss/libraries/go/application/xflags
options: options:
commits: commits:
filters: filters:
......
<a name="v1.1.1"></a>
## [v1.1.1] - 2022-10-05
### Bug Fixes
- fix repository_url was wrong
<a name="v1.1.0"></a> <a name="v1.1.0"></a>
## [v1.1.0] - 2022-10-05 ## [v1.1.0] - 2022-10-05
<a name="v1.0.0"></a> <a name="v1.0.0"></a>
## v1.0.0 - 2022-10-04 ## v1.0.0 - 2022-10-04
[v1.1.0]: https://gitlab.schukai.com/oss/libraries/go/application/configuration/compare/v1.0.0...v1.1.0 [v1.1.1]: https://gitlab.schukai.com/oss/libraries/go/application/xflags/compare/v1.1.0...v1.1.1
[v1.1.0]: https://gitlab.schukai.com/oss/libraries/go/application/xflags/compare/v1.0.0...v1.1.0
...@@ -65,9 +65,9 @@ The following tags are supported: ...@@ -65,9 +65,9 @@ The following tags are supported:
| `required` | Value | Flag is required. | | `required` | Value | Flag is required. |
| `command` | Command | Flag is a command. | | `command` | Command | Flag is a command. |
| `call` | Command | Function to call when the command is used. | | `call` | Command | Function to call when the command is used. |
| `shadow` | Value | Copy the value to the shadow structure. |
| `ignore` | -/- | Property is ignored. | | `ignore` | -/- | Property is ignored. |
### Callbacks ### Callbacks
The functions are called up with a receiver. The receiver is the The functions are called up with a receiver. The receiver is the
...@@ -143,6 +143,30 @@ The function `Execute()` executes the command. See the section ...@@ -143,6 +143,30 @@ The function `Execute()` executes the command. See the section
setting.Execute() setting.Execute()
``` ```
### Shadow
The shadow structure is used to copy the values of the flags to the
shadow structure. The shadow structure is set using the `SetShadow()`
and configured using the tag `shadow`.
```go
type Shadow struct {
Verbose bool
Serve struct {
Host string
Port int
}
}
func main() {
setting := New(os.Args[0], Definition{})
setting.SetShadow(Shadow{})
setting.Parse(os.Args[1:])
setting.Execute()
fmt.Printf("Shadow: %+v", setting.GetShadow())
}
```
## Contributing ## Contributing
Merge requests are welcome. For major changes, please open an issue first to discuss what Merge requests are welcome. For major changes, please open an issue first to discuss what
......
{"version":"1.1.0"} {"version":"1.1.1"}