Closed csjones closed 3 years ago
Hey @csjones, thank you for your contribution. You've prompted a discussion on our end with this PR about whether quiet, output only commands should be the default response. That is, whether or not this should be implemented as only logging these Certificate downloaded
Certificate revoked
messages when a --verbose
flag is passed.
This would then need to be rolled out across other commands so that the output of all commands is parsable by default. Did you have any other thoughts on the matter for your use case?
I agree with @adamjcampbell here. I think the stuff like π₯ Profile 'X' downloaded to: ...
should only be printed when a --verbose
flag was in effect.
π€ One thing to consider is perhaps when using --json
, --yaml
, and --csv
, --verbose
could be false
but with --table
it could be true
? Given that the computer parsable formats are more likely to be used in pipes than the table output which is designed for interactive use. Thoughts?
Hey @adamjcampbell @orj, I'm in favor of these changes. I think machine parsable by default and a --verbose
option instead of --quiet
makes a lot of sense, especially for my use case. Also makes sense to default --verbose
to true
when using the human parseable --table
option.
I would propose one more additional change. When using --json
(or any machine parsable format) to minimize the output by default instead of pretty printing the output. Currently, --json
is using a prettify option and adds additional whitespace and newlines which needs to be filtered out.
@csjones sounds good to me. Are you happy to make those changes for this command / this PR?
In regards to the pretty formatting of json I would think filtering out the white space would be optional. It shouldn't affect the ability to parse the JSON. However we could have it as an option or the default when not in verbose mode.
What are your thoughts on the matter?
@adamjcampbell Perhaps we can have a --pretty
option for prettifying the json
. Mostly I think you would be piping json output into a tool like jq
and jq
can pretty it for you.
@adamjcampbell Sure! I'll make the changes and update the PR. For pretty printing output, I'm leaning towards removing .prettyPrinted
since --pretty
currently does not exist and I prefer @orj's idea of using jq
if needed because my use case is aimed towards better accommodating machine parsable output. Additionally, I could also create a new GitHub issue to add a --pretty
option and see if any other asc
users would prefer to have this feature flag added.
Does this list of changes look good?
Summary of changes:
--quiet
to be --verbose
--verbose
defaults to false
except when --table
is used.prettyPrinted
--pretty
feature flag@csjones sounds like a plan! Thanks for all your efforts on this.
π€ Objective and Motivation
The objective of these changes are to purpose adding an optional flag
-v/--verbose
to display more output in terminal. My motivation for this flag is to remove overhead when usingasc
with ansible. I'm using the following command in my ansible playbook:...and I get the following output:
The
"stdout"
is now malformed json and requires additional parsing to work correctly by filtering out the"π₯ Profile 'App Store Test001010002' downloaded to: ./aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa.mobileprovision\n"
. With the--verbose
flag added, the command now looks like this:...and I get the following output:
...and the default command and output looks like this:
...and the json returned to stdout is no longer malformed so now I get the following output:
π Summary of Changes
Changes proposed in this pull request:
-v/--verbose
to display more in terminal..prettyPrinted
and created https://github.com/ittybittyapps/appstoreconnect-cli/issues/221β οΈ Items of Note
Document anything here that you think the reviewer(s) of this PR may need to know, or would be of specific interest.
The
--verbose
only changes the output of aCommonParsableCommand
that has not been commented with aTODO
.π§π Reviewer Notes
π Example
π¨ How To Test
Run these command and notice the messaging in terminal:
Run the same commands with
-v/--verbose
added and notice more messaging in terminal: