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

Adds open command for quickly opening Svix's hosted docs #15

Merged
merged 5 commits into from
Jun 4, 2021
Merged

Adds open command for quickly opening Svix's hosted docs #15

merged 5 commits into from
Jun 4, 2021

Conversation

codepope
Copy link
Contributor

@codepope codepope commented Jun 4, 2021

Always handy, svix docs will open the docs page in whatever browser is configured for the environment.

@tasn tasn requested a review from svix-frank June 4, 2021 10:50
@svix-frank
Copy link
Contributor

svix-frank commented Jun 4, 2021

Always handy, svix docs will open the docs page in whatever browser is configured for the environment.

Hey @codepope thanks for the PR! I think it will be great to quickly access our hosted pages such as docs from the cli!

Just a few thoughts,

  1. Since we likely will have more pages we'd like to be able to open in the future; I think we should break this out into a svix open command with docs as the first positional arg. That way we can add more pages easily without adding new functions (I can think of the dashboard as one we might want to add soon!). You can take a look at the completion function for a good example of how this might be implemented.

  2. If we fail to open the URL we can print it as a terminal hyperlink so that users can still navigate to the page they requested (I have a bit of code commented at the end of pretty/print.go which you should be able to use for this =).

Let me know if you want any help with these suggestions or have any other thoughts!

@codepope
Copy link
Contributor Author

codepope commented Jun 4, 2021

Now has open command with docs or api as first parameters and a basic 'long' help to point the way
Also pretty prints the URL on fail to open browser. Small Todo; need to check in an uncommented pretty to use the hyperlink function there. Marked as such.

@svix-frank svix-frank changed the title Added a docs command Adds open command for quickly opening svix hosted doc pages Jun 4, 2021
@svix-frank svix-frank changed the title Adds open command for quickly opening svix hosted doc pages Adds open command for quickly opening Svix's hosted docs Jun 4, 2021
Copy link
Contributor

@svix-frank svix-frank left a comment

Choose a reason for hiding this comment

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

Thanks again @codepope for the PR!

@svix-frank svix-frank merged commit 4ef6409 into svix:main Jun 4, 2021
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.

2 participants