Skip to content

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

Description

@nvanthao

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions