Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit e3a82e4

Browse files
authored
Consolidate flags for all commands (#24)
## Summary Consolidate flags for all commands ## How was it tested? launchpad <cmd> --help ## Is this change backwards-compatible? Yes
1 parent c028493 commit e3a82e4

File tree

4 files changed

+13
-24
lines changed

4 files changed

+13
-24
lines changed

padcli/command/build.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ func registerEmbeddedBuildFlags(cmd *cobra.Command, opts *embeddedBuildOptions)
118118
"adds BUILDKIT_INLINE_CACHE=1 build arg to save cache metadata and also "+
119119
"sets the cache-from docker build option",
120120
)
121+
_ = cmd.Flags().MarkHidden("remote-cache")
121122

122123
cmd.Flags().StringVar(
123124
&opts.LocalImage,

padcli/command/env.go

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ import (
1515
"go.jetpack.io/launchpad/pkg/jetlog"
1616
)
1717

18-
type envOptions struct {
19-
projectConfigPath string
20-
}
21-
2218
func envCmd() *cobra.Command {
23-
opts := &envOptions{}
2419
cmdCfg := &envcli.CmdConfig{}
2520
command := &cobra.Command{
2621
Use: "env",
@@ -31,15 +26,12 @@ func envCmd() *cobra.Command {
3126
Securely stores and retrieves environment variables on the cloud.
3227
Environment variables are always encrypted, which makes it possible to
3328
store values that contain passwords and other secrets.
29+
30+
This command can only be run within a Launchpad project's directory (the directory
31+
where launchpad.yaml is present)
3432
`),
3533
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
36-
var absProjectPath string
37-
var err error
38-
if opts.projectConfigPath == "" {
39-
absProjectPath, err = getProjectDir()
40-
} else {
41-
absProjectPath, err = absPath([]string{opts.projectConfigPath})
42-
}
34+
absProjectPath, err := getProjectDir()
4335
if err != nil {
4436
return errors.WithStack(err)
4537
}
@@ -80,14 +72,6 @@ func envCmd() *cobra.Command {
8072
},
8173
}
8274

83-
command.PersistentFlags().StringVarP(
84-
&opts.projectConfigPath,
85-
"project",
86-
"p",
87-
"",
88-
"Path to project config. If directory, we assume name is launchpad.yaml",
89-
)
90-
9175
command.AddCommand(
9276
envcli.SetCmd(cmdCfg),
9377
envcli.RemoveCmd(cmdCfg),

padcli/command/up.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,25 +181,31 @@ func registerDeployFlags(cmd *cobra.Command, opts *deployOptions) {
181181
"",
182182
"custom location for app chart",
183183
)
184+
_ = cmd.Flags().MarkHidden("helm.app.chart-location")
185+
184186
cmd.Flags().StringVar(
185187
&opts.App.Name,
186188
"helm.app.name",
187189
"",
188190
"App install name",
189191
)
192+
_ = cmd.Flags().MarkHidden("helm.app.name")
190193

191194
cmd.Flags().StringVar(
192195
&opts.Runtime.SetValues,
193196
"helm.runtime.set",
194197
"",
195198
"args passed to helm --set option for runtime (can specify multiple or separate values with commas: key1=val1,key2=val2)",
196199
)
200+
_ = cmd.Flags().MarkHidden("helm.runtime.set")
201+
197202
cmd.Flags().StringVar(
198203
&opts.Runtime.ChartLocation,
199204
"helm.runtime.chart-location",
200205
"",
201206
"custom location for runtime chart",
202207
)
208+
_ = cmd.Flags().MarkHidden("helm.runtime.chart-location")
203209

204210
cmd.Flags().StringVarP(
205211
&opts.Namespace,
@@ -251,16 +257,14 @@ func registerDeployFlags(cmd *cobra.Command, opts *deployOptions) {
251257
"",
252258
envOverrideFlagMsg,
253259
)
254-
// Made env-override file flag hidden temporarily until we decide on concrete approach
255-
// on whether override merges with launchpad env or skips it
256-
_ = cmd.Flags().MarkHidden(envOverrideFlag)
257260

258261
cmd.Flags().StringVar(
259262
&opts.execQualifiedSymbol,
260263
"exec",
261264
"",
262265
"Execute a single cronjob or jetroutine for a given function.",
263266
)
267+
_ = cmd.Flags().MarkHidden("exec")
264268

265269
cmd.Flags().BoolVar(
266270
&opts.ReinstallOnHelmUpgradeError,

padcli/jetconfig/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ package jetconfig
22

33
import "github.com/pkg/errors"
44

5-
var ErrConfigNotFound = errors.New("jetconfig was not found")
5+
var ErrConfigNotFound = errors.New("jetconfig (launchpad.yaml) was not found")
66
var ErrInvalidProjectID = errors.New("project ID is invalid")

0 commit comments

Comments
 (0)