Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change alias list output format to YAML #6603

Merged
merged 4 commits into from Dec 13, 2022
Merged

Conversation

ptforness
Copy link
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
@cliAutomation cliAutomation added this to Needs review 🤔 in The GitHub CLI Nov 14, 2022
Copy link
Contributor

@mislav mislav left a comment

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
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
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
Copy link
Contributor

samcoe commented Dec 5, 2022

@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
Copy link
Contributor

@mislav mislav left a comment

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.

The GitHub CLI automation moved this from Needs review 🤔 to Needs to be merged 🎉 Dec 13, 2022
@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
The GitHub CLI automation moved this from Needs to be merged 🎉 to Pending Release 🥚 Dec 13, 2022
@github-actions github-actions bot moved this from Pending Release 🥚 to Done 💤 in The GitHub CLI Dec 22, 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
No open projects
The GitHub CLI
  
Done 💤
Development

Successfully merging this pull request may close these issues.

gh alias list should print machine consumable output
4 participants