ittybittyapps / appstoreconnect-cli

An easy to use command-line tool for interacting with the Apple AppStore Connect API
MIT License
174 stars 17 forks source link

Add a flag to prettify output #221

Open csjones opened 4 years ago

csjones commented 4 years ago

šŸ—£ Context

When outputting with the format --csv, --json, or --yaml

šŸ’¬ Narrative

As a user I want the command output to be easily parsable by me So that I can quickly debug a command result

šŸ“ Notes

Idea originates from https://github.com/ittybittyapps/appstoreconnect-cli/pull/220 where it was discussed to have output of all commands is parsable by default.

šŸŽØ Design

Provide design example, screenshot, text input/output etc

asc certificates list --json

{"example":{"sample":[{"example":"sample","random_value":8.95}]}}

asc certificates list --pretty --json

{
   "example":{
      "sample":[
         {
            "example":"sample",
            "random_value":8.95
         }
      ]
   }
}

asc certificates list --csv

CERT,DATESMPL,EXAMPLE,SAMPLE
M109UYTGSF007,08/01/2020 13:51:00,true,false
M109UYTGSF007,08/02/2020 13:56:01,false,false
M109UYTGSF007,08/03/2020 13:55:02,false,false
M109UYTGSF007,08/04/2020 13:54:03,true,true
M109UYTGSF007,08/05/2020 13:55:04,false,true

asc certificates list --pretty --csv

    CERT               DATESMPL            EXAMPLE     SAMPLE
M109UYTGSF007    08/01/2020 13:51:00         true       false
M109UYTGSF007    08/02/2020 13:56:01        false       false
M109UYTGSF007    08/03/2020 13:55:02        false       false
M109UYTGSF007    08/04/2020 13:54:03         true        true
M109UYTGSF007    08/05/2020 13:55:04        false        true

āœ… Acceptance Criteria

GIVEN there is output that can be prettified with a command WHEN the command is executed with --pretty THEN the output is formatted for easy readability

šŸš« Out of Scope

The scope making command output pretty is limited to --csv, --json, or --yaml.