Skip to content

Commit 739064e

Browse files
authored
Merge pull request #3 from m-mizutani/enhance/cli-opt-envvar
Add environment variables for configuration and execution
2 parents 8ccfec9 + 63fb4aa commit 739064e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkg/controller/cli/cli.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func Run(argv []string) error {
3232
Aliases: []string{"c"},
3333
Usage: "Path to configuration file",
3434
Destination: &configPath,
35+
EnvVars: []string{"HATCHERY_CONFIG"},
3536
Required: true,
3637
},
3738
}, logger.Flags(), sentry.Flags()),

pkg/controller/cli/exec.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,21 @@ func cmdExec(rt *runtime) *cli.Command {
3333
Name: "id",
3434
Aliases: []string{"i"},
3535
Usage: "Action ID",
36+
EnvVars: []string{"HATCHERY_EXEC_ID"},
3637
Destination: &actionIDs,
3738
},
3839
&cli.BoolFlag{
3940
Name: "all",
4041
Aliases: []string{"a"},
4142
Usage: "Execute all actions",
43+
EnvVars: []string{"HATCHERY_EXEC_ALL"},
4244
Destination: &allAction,
4345
},
4446
&cli.BoolFlag{
4547
Name: "dry-run",
4648
Aliases: []string{"d"},
4749
Usage: "Dry run",
50+
EnvVars: []string{"HATCHERY_EXEC_DRY_RUN"},
4851
Destination: &dryRun,
4952
},
5053
},

0 commit comments

Comments
 (0)