Description
ossie plugin list accepts arbitrary positional arguments, silently ignores them, and exits successfully.
Steps to reproduce
ossie plugin list unexpected
echo $?
Actual behavior
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
Description
ossie plugin listaccepts arbitrary positional arguments, silently ignores them, and exits successfully.Steps to reproduce
Actual behavior
The argument is ignored and the command reports success. Multiple arguments behave the same way.
Expected behavior
Because
plugin listdoes not accept positional arguments, it should reject them with a non-zero exit status and show command usage, consistent with other CLI commands such asplugin remove.Cause
The
listCmddefinition does not set anArgsvalidator. Cobra treats a nil validator as accepting arbitrary arguments.Suggested fix
Add
Args: cobra.NoArgstolistCmdand add tests for zero, one, and multiple positional arguments.Environment
88e0011go1.26.2 darwin/arm64