Skip to content

export: -o means output file and shadows the global -o/--output format flag #28

Description

@timimsms

Context

Every other command uses the global -o/--output flag for output format (table, json, yaml, csv). cu export tasks redefines -o as the output file path, so users who learned -o json elsewhere end up with a file literally named json in their working directory instead of JSON on stdout.

Evidence

  • internal/cmd/export.goexport tasks binds -o/--output to the destination file path, shadowing the global format flag.
  • Global flag (root command): -o, --output selects the output format across the rest of the CLI.
  • Repro: cu export tasks -o json writes a file named json rather than emitting JSON.

Suggested fix

Rename export's file flag to --file/-F (keeping --format for the export format), and let the global -o retain its format meaning. If backward compatibility matters, accept the old spelling for a deprecation window with a warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions