Description
harbor artifact view currently uses Run and logs errors internally instead of returning them to Cobra.
As a result, failure paths can still exit with code 0, which breaks scripting/CI expectations.
Steps to Reproduce
- Run:
env XDG_CONFIG_HOME=/tmp/harbor-cli-verify/config \
XDG_DATA_HOME=/tmp/harbor-cli-verify/data \
./bin/harbor-cli artifact view bad-format
echo $?
- Observe the command fails logically, but exit code is 0.
Expected Behavior
When input parsing or API calls fail, the command should return a Cobra error and exit non-zero.
Actual Behavior
The command logs errors and returns from the Run closure, so process exit code can remain 0.
Environment
Additional Context

Description
harbor artifact viewcurrently usesRunand logs errors internally instead of returning them to Cobra.As a result, failure paths can still exit with code
0, which breaks scripting/CI expectations.Steps to Reproduce
Expected Behavior
When input parsing or API calls fail, the command should return a Cobra error and exit non-zero.
Actual Behavior
The command logs errors and returns from the Run closure, so process exit code can remain 0.
Environment
Additional Context