NSFS | NC | CLI | CLI commands responses & errors refactor, --show_secrets and lstat linux fix #7655
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explain the changes
This PR suggests changing all cli responses / errors written to stdout to be of json format. notice that help will be printed only by help command, and no longer be available after printing errors.
create/update/status commands will result a json containing Status of the manipulated entity.
list command will result a json containing List of the listed entities.:
2.1. added write_stdout_response() and throw_cli_error() functions in order to have a single place where we write to stdout.
2.2. replaced all stdout.write() calls to call the new functions while specifying the new error/response type.
2.3. some refactoring of is_undefined(value), the validation functions.
2.4. added --show-secrets flag.
Issues: Fixed #xxx / Gap #xxx
Testing Instructions: