Page MenuHomeVyOS Platform

Make cli-shell-api correctly exit with non-zero code on failures
Closed, ResolvedPublic

Description

Right now, cli-shell-api always succeeds even when an operation has obviously failed. It does know about failures and prints appropriate messages, but never sets the exit code.
For example, cli-shell-api showConfig not failing for invalid or empty paths makes us explicitly check is a path exists.

In other words... Currnet behaviour:

$ cli-shell-api showConfig foo || echo Fail
Specified configuration path is not valid

Desired behaviour:

$ cli-shell-api showConfig foo || echo Fail
Specified configuration path is not valid
Fail

We likely want to add unique exit codes for different conditions.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Improvement (missing useful functionality)