mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 23:24:01 +03:00
Move config path cli parameter to base
This commit is contained in:
+2
-4
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user