X Tutup
Skip to content

Add env command#1690

Closed
samcoe wants to merge 1 commit intotrunkfrom
env-cmd
Closed

Add env command#1690
samcoe wants to merge 1 commit intotrunkfrom
env-cmd

Conversation

@samcoe
Copy link
Copy Markdown
Contributor

@samcoe samcoe commented Sep 13, 2020

This PR adds an env command that displays current environment variable values that GH uses. Adding the --verbose flag will output a desription of how each of the environment variables is used.

Screen Shot 2020-09-13 at 1 51 22 PM

Screen Shot 2020-09-13 at 1 51 45 PM

Screen Shot 2020-09-13 at 1 52 09 PM

Screen Shot 2020-09-13 at 2 29 24 PM

closes #1384

@samcoe samcoe changed the title WIP Add env command Sep 13, 2020
}

flagUsages := command.LocalFlags().FlagUsages()
flagUsages := command.Flags().FlagUsages()
Copy link
Copy Markdown
Contributor Author

@samcoe samcoe Sep 13, 2020

Choose a reason for hiding this comment

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

@mislav @vilmibm Is there a reason why this is currently only using LocalFlags()?

@samcoe samcoe marked this pull request as ready for review September 13, 2020 11:57
Copy link
Copy Markdown
Contributor

@vilmibm vilmibm left a comment

Choose a reason for hiding this comment

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

thank you!!

I really like the --verbose idea; I don't think I want that to go away, but I would still like information about environment variables in gh help env

Copy link
Copy Markdown
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.

Nice work, @samcoe!

Transferring conclusions we've made in chat to here: although I generally like the idea of a command that helps user debug their environment and their setup, I think this PR as of right now loses sight of the issue #1384 it was supposed to address: to extract documentation about environment variables to its own help page. In this branch, running gh help env does not print information about available environment variables, and so this information wouldn't make it to man pages on our website either.

I definitely want us to explore making a runnable command for the purpose of debugging, but I would suggest that it's ideally done separately after we've already addressed the documentation bit.

For now, we could still go the route of creating a separate command, possibly marking it as "hidden" too and making it non-runnable for now.

@samcoe
Copy link
Copy Markdown
Contributor Author

samcoe commented Sep 14, 2020

Closing in favor of #1696

@samcoe samcoe closed this Sep 14, 2020
@samcoe samcoe deleted the env-cmd branch September 14, 2020 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract docs about supported environment variables into its own help page

3 participants

X Tutup