Skip to content

Commit 8069d6a

Browse files
gr0migmartri
andauthored
Remove the --filename flag and update the -f description (#2215)
Signed-off-by: Rafał Kuć <[email protected]> Signed-off-by: Rafał Kuć <[email protected]> Co-authored-by: Miguel Martinez Trivino <[email protected]>
1 parent b0fff31 commit 8069d6a

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

app/cli/cmd/plugins.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ func newPluginDescribeCmd() *cobra.Command {
245245

246246
func newPluginInstallCmd() *cobra.Command {
247247
var file string
248-
var filename string
249248
var location string
250249

251250
cmd := &cobra.Command{
@@ -257,7 +256,6 @@ func newPluginInstallCmd() *cobra.Command {
257256

258257
opts := &action.PluginInstallOptions{
259258
File: file,
260-
Filename: filename,
261259
Location: location,
262260
}
263261

@@ -272,8 +270,7 @@ func newPluginInstallCmd() *cobra.Command {
272270
}
273271

274272
// Common flags
275-
cmd.Flags().StringVarP(&file, "file", "f", "", "URL of the plugin to download (required)")
276-
cmd.Flags().StringVarP(&filename, "filename", "", "", "Custom filename to save the plugin as (optional)")
273+
cmd.Flags().StringVarP(&file, "file", "f", "", "URL or path to the plugin to install")
277274
cobra.CheckErr(cmd.MarkFlagRequired("file"))
278275

279276
return cmd

app/cli/documentation/cli-reference.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,9 +1281,8 @@ chainloop config plugin install [flags]
12811281
Options
12821282

12831283
```
1284-
-f, --file string URL of the plugin to download (required)
1285-
--filename string Custom filename to save the plugin as (optional)
1286-
-h, --help help for install
1284+
-f, --file string URL or path to the plugin to install
1285+
-h, --help help for install
12871286
```
12881287

12891288
Options inherited from parent commands

app/cli/internal/action/plugin_actions.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,7 @@ func (action *PluginInstall) Run(_ context.Context, opts *PluginInstallOptions)
172172

173173
// determine filename
174174
filename := filepath.Base(opts.File)
175-
if opts.Filename != "" {
176-
filename = opts.Filename
177-
action.cfg.Logger.Debug().Str("customFilename", opts.Filename).Msg("Using custom filename")
178-
} else if filename == "." || filename == "/" {
175+
if filename == "." || filename == "/" {
179176
action.cfg.Logger.Error().Str("file", opts.File).Msg("Invalid URL or object key, could not determine filename")
180177
return nil, fmt.Errorf("invalid URL or object key, could not determine filename")
181178
}

0 commit comments

Comments
 (0)