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

Run a CLI command and capture output for Markdown #710

Open
joelverhagen opened this issue Apr 29, 2024 · 0 comments
Open

Run a CLI command and capture output for Markdown #710

joelverhagen opened this issue Apr 29, 2024 · 0 comments

Comments

@joelverhagen
Copy link

I am not certain if a PR for this proposal will be accepted.

Is the feature request related to a problem

In Markdown document for CLI tools, I would like to show sample output from CLI command.

For example, if my repo is a CLI tool I may want to show the list of options by putting the latest content of dotnet run -- --help into my Markdown in the place of a snippet placeholder.

Describe the solution

The snippet placeholder could have the format cli: <CLI command> like this:

See the tool's help text below for a full description of all options.
snippet: cli: dotnet run -- --help

Or perhaps cli-snippet: dotnet run -- --help

The output would be wrapped in

```plaintext

This is kind of like the http snippets except the content is fetched locally instead of from a remote server.

Describe alternatives considered

  • Manually update the Markdown with the help text -- this is error-prone since I often forget to update the Markdown so the README ends up being stale.
  • Write my own tool with much of the same common infrastructure as MarkdownSnippets

Additional context

Here is a sample README of mine with help text:
https://github.com/joelverhagen/PackageLifeCycle?tab=readme-ov-file#help-text

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

No branches or pull requests

1 participant