replicatedhq / replicatedhq/replicated

cli: customer download-license --output flag shadows global --output format flag

Open
#748 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
36
Forks
25
Avg merge
9h 27m
Merged PRs (30d)
3

Description

Problem

The customer download-license command registers a local --output (short: -o) flag that specifies a file path for writing the downloaded license:

cmd.Flags().StringVarP(&output, "output", "o", "-", "Path to output license to. Defaults to stdout")

This shadows the global persistent --output flag (which controls output formatting: json|table|wide) introduced in #740.

Impact

Running:

replicated customer download-license --customer cus_xxx --output json

does not format the license as JSON. Instead, it writes the license YAML to a file literally named json.

This is confusing and inconsistent with every other command in the CLI.

Suggested Fix (non-breaking)

Deprecate the current --output / -o file-path flag and introduce a new flag for file output:

  1. Add --path (or --output-file) as the new file-path destination flag.
  2. Deprecate --output on this command (or remove its short form -o) so it falls through to the global --output persistent flag for formatting.
  3. Consider whether JSON output is actually useful for a raw license YAML download.

Context

This was explicitly called out in review of #740 by @xavpaice and deferred to a follow-up PR to avoid making a breaking change in the global output flag refactoring.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the customer download-license command registration and inspect its local --output/-o flag alongside the global persistent --output formatting flag. Verify the reported command behavior, then make file output use the new destination flag while preserving global format handling and confirm the command no longer writes to a file named json.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.