Move config path cli parameter to base

This commit is contained in:
9seconds
2021-03-18 15:20:54 +03:00
parent f155b9f37e
commit 0ad2d61742
4 changed files with 12 additions and 12 deletions
+2 -4
View File
@@ -34,18 +34,16 @@ type accessResponseURLs struct {
}
type Access struct {
base `kong:"-"`
base
PublicIPv4 net.IP `kong:"help='Public IPv4 address for proxy. By default it is resolved via remote website',name='ipv4',short='i'"` // nolint: lll
PublicIPv6 net.IP `kong:"help='Public IPv6 address for proxy. By default it is resolved via remote website',name='ipv6',short='I'"` // nolint: lll
Port uint `kong:"help='Port number. Default port is taken from configuration file, bind-to parameter',type:'uint',short='p'"` // nolint: lll
Hex bool `kong:"help='Print secret in hex encoding.',short='x'"`
ConfigPath string `kong:"arg,required,type='existingfile',help='Path to the configuration file.',name='config-path'"` // nolint: lll
}
func (c *Access) Run(cli *CLI, version string) error {
if err := c.ReadConfig(cli.Access.ConfigPath, version); err != nil {
if err := c.ReadConfig(version); err != nil {
return fmt.Errorf("cannot init config: %w", err)
}