feat: refactor configuration handling in main function (#275)

- Add `FilePath` attribute with value `.host` to the configuration in `main` function

Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2024-06-01 09:50:16 +08:00 committed by GitHub
parent 2e8030ff52
commit dc026ac547
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 4 deletions

View File

@ -38,10 +38,11 @@ func main() {
app.Version = Version app.Version = Version
app.Flags = []cli.Flag{ app.Flags = []cli.Flag{
&cli.StringSliceFlag{ &cli.StringSliceFlag{
Name: "host", Name: "host",
Aliases: []string{"H"}, Aliases: []string{"H"},
Usage: "connect to host", Usage: "connect to host",
EnvVars: []string{"PLUGIN_HOST", "SSH_HOST", "INPUT_HOST"}, EnvVars: []string{"PLUGIN_HOST", "SSH_HOST", "INPUT_HOST"},
FilePath: ".host",
}, },
&cli.IntFlag{ &cli.IntFlag{
Name: "port", Name: "port",