Skip to content

cli: plugin list silently ignores unexpected positional arguments #334

Description

@iamrajatrana

Description

ossie plugin list accepts arbitrary positional arguments, silently ignores them, and exits successfully.

Steps to reproduce

ossie plugin list unexpected
echo $?

Actual behavior

no plugins installed
0

The argument is ignored and the command reports success. Multiple arguments behave the same way.

Expected behavior

Because plugin list does not accept positional arguments, it should reject them with a non-zero exit status and show command usage, consistent with other CLI commands such as plugin remove.

Cause

The listCmd definition does not set an Args validator. Cobra treats a nil validator as accepting arbitrary arguments.

Suggested fix

Add Args: cobra.NoArgs to listCmd and add tests for zero, one, and multiple positional arguments.

Environment

  • Apache Ossie commit: 88e0011
  • Go: go1.26.2 darwin/arm64
  • OS: macOS arm64

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