diff --git a/README.md b/README.md index ed6eacb..a71650d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,49 @@ # GitHub Action Document Writer -Creates a README for GitHub actions from an `action.yml` file. +Provides an opinionated command line application to generated READMEs for +[GitHub Actions] and [GitHub Workflows]. + +## Usage + +### Documenting GitHub Actions + +``` +$ github-action-doc action -h +Generate documentation for a Github action + +USAGE: + github-action-doc action + +ARGS: + + +OPTIONS: + -h, --help Print help information + +``` + +### Documenting GitHub Workflows + +``` +$ github-action-doc workflow -h +Generate documentation for a Github workflow + +USAGE: + github-action-doc workflow + +ARGS: + + +OPTIONS: + -h, --help Print help information +``` + +## Examples + +### Actions + +* [`actions/checkout@v3`](https://gist.github.com/foo4u/3935d6d9b41fe92b19077515c7a035e5#file-checkout_readme-md) +* [`actions/setup-java@v3`](https://gist.github.com/foo4u/3935d6d9b41fe92b19077515c7a035e5#file-setup_java_jdk_readme-md) + +[GitHub Actions]: https://docs.github.com/en/actions/learn-github-actions/essential-features-of-github-actions +[GitHub Workflows]: https://github.com/features/actions diff --git a/src/cli.rs b/src/cli.rs index 0a4bc94..4697a28 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -2,7 +2,7 @@ use clap::{Subcommand}; use clap::Parser; #[derive(Debug, Parser)] -#[clap(name = "github_action_doc")] +#[clap(name = "github-action-doc")] #[clap(about = "A GitHub action & workflow readme writer", long_about = None)] pub struct Cli { #[clap(subcommand)] @@ -17,6 +17,8 @@ pub enum Commands { #[clap(required = true, value_parser)] action_file: String }, + #[clap(arg_required_else_help = true)] + #[clap(about = "Generate documentation for a Github workflow", long_about = None)] Workflow { #[clap(required = true, value_parser)] workflow_file: String