Skip to content

Change alias list output format to YAML - #6603

Merged
mislav merged 4 commits into
cli:trunkfrom
ptforness:alias-list-json
Dec 13, 2022
Merged

mislav merged 4 commits into
cli:trunkfrom
ptforness:alias-list-json

Conversation

@ptforness

Copy link
Copy Markdown
Contributor

Fixes #6497

I used JSON instead of YAML as the output format, but if there's a preference towards YAML I can update it.

@ptforness
ptforness requested a review from a team as a code owner November 14, 2022 03:28
@ptforness
ptforness requested review from samcoe and removed request for a team November 14, 2022 03:28
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Nov 14, 2022

@mislav mislav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on! Let's use YAML as it's more readable in its raw format than JSON.

@ptforness

Copy link
Copy Markdown
Contributor Author

@mislav Sure thing! I should have enough time to do that in the next day or two.

@samcoe samcoe self-assigned this Nov 16, 2022
@ptforness

Copy link
Copy Markdown
Contributor Author

@mislav I changed the output format to yaml and am looking into why the value of the gc alias is getting single-quoted (it's not occurring outside the test in command prompt, powershell, or bash).

@samcoe

samcoe commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

@mislav Quick question here, do we want to keep the table output for TTY mode and just output YAML when in NOTTY mode?

@samcoe
samcoe requested a review from mislav December 12, 2022 08:39

@mislav mislav left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me; thank you! I've pushed a change that preserves newlines in alias expansions, since if we scrub them we risk breaking the expansion script.

@samcoe For simplicity sake, let's just output the same YAML in both non-TTY and TTY modes. Table output doesn't play well with multiline aliases anyway, and YAML handles it reasonably well.

@mislav mislav changed the title Change alias list output format to JSON Change alias list output format to YAML Dec 13, 2022
@mislav
mislav merged commit e86b3ea into cli:trunk Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh alias list should print machine consumable output

4 participants