replicatedhq / replicatedhq/replicated
cli: customer download-license --output flag shadows global --output format flag
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:
- Add
--path(or--output-file) as the new file-path destination flag. - Deprecate
--outputon this command (or remove its short form-o) so it falls through to the global--outputpersistent flag for formatting. - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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