Summary
dws aitable export data cannot accept the global output flag -f / -f json. It fails with unknown shorthand flag: 'f' in -f.
Repro (deterministic, 3/3)
$ dws aitable export data -f json
{"error":{"category":"internal","code":5,"message":"unknown shorthand flag: 'f' in -f\nSee 'dws aitable export data --help' for usage."}}
Sibling commands are fine:
$ dws aitable base list -f json # returns JSON normally
Root cause
internal/helpers/aitable_export_import.go:67 registers a local flag with the same long name as the global persistent output flag --format / -f:
cmd.Flags().String("format", "", i18n.T("导出格式:excel、attachment、excel_and_attachment、excel_with_inline_images"))
This local --format (export format) has no -f shorthand, so it shadows the global persistent --format/-f and the -f shorthand binding is lost on this command.
Precedent in this repo
The doc export path already avoids the collision by using --export-format:
internal/helpers/doc.go:166 → cmd.Flags().String("export-format", "", ...).
Suggested fix
Rename the aitable export local flag to --export-format (align with doc.go), or otherwise avoid colliding with the global --format/-f.
Impact
dws aitable export data cannot use -f json / any -f output format; breaks JSON-only / MCP consumers. Found on v1.0.34 (1e95d03).
Summary
dws aitable export datacannot accept the global output flag-f/-f json. It fails withunknown shorthand flag: 'f' in -f.Repro (deterministic, 3/3)
Sibling commands are fine:
Root cause
internal/helpers/aitable_export_import.go:67registers a local flag with the same long name as the global persistent output flag--format/-f:This local
--format(export format) has no-fshorthand, so it shadows the global persistent--format/-fand the-fshorthand binding is lost on this command.Precedent in this repo
The doc export path already avoids the collision by using
--export-format:internal/helpers/doc.go:166→cmd.Flags().String("export-format", "", ...).Suggested fix
Rename the aitable export local flag to
--export-format(align withdoc.go), or otherwise avoid colliding with the global--format/-f.Impact
dws aitable export datacannot use-f json/ any-foutput format; breaks JSON-only / MCP consumers. Found on v1.0.34 (1e95d03).