Skip to content

Commit

Permalink
docs(cli): expand init command rustdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
ekkolon committed Jan 31, 2024
1 parent a3e246a commit c31a717
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ use verify::VerifyArgs;

use add::AddArgs;

/// Licensia is an experimental CLI tool to enforce, verify, apply and modify
/// file license headers for a variaty of programming languages.
/// Licensa is a powerful CLI tool designed for seamless source code license management.
///
/// Developers can effortlessly verify, apply, modify, and enforce SPDX license headers
/// across their source code.
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
#[command(propagate_version = true)]
Expand All @@ -41,9 +43,35 @@ pub struct Cli {

#[derive(Subcommand, Debug)]
pub enum SubCommands {
/// Verify presence of license headers in one or more files.
/// Initialize Licensa configuration for the current workspace.
///
/// A glob pattern may be used to verify multiple files that recursively.
/// The `init` command simplifies the configuration process by creating a `.licensarc` file
/// in the current working directory. This file contains workspace-wide Licensa configurations,
/// eliminating the need to pass them as arguments for subsequent subcommands like `apply`.
///
/// When you run the `init` command, the following steps are performed:
///
/// 1. Creation of a `.licensarc` file based on the provided command arguments.
///
/// 2. Generation of a `.licensaignore` file containing glob patterns.
///
/// # Errors
///
/// The `init` workflow fails in the following scenarios:
///
/// - The current working directory already contains a `.licensarc` file.
///
/// - Invalid arguments are provided.
///
/// # Examples:
///
/// ```bash
/// licensa init --owner "Your Name" --year 2022 --type MIT
/// ```
///
/// This example initializes Licensa with your specified name, copyright year, and license type.
///
/// Note: The `init` command should be executed at the root of your project.
#[command(name = "init")]
Init(InitArgs),

Expand Down

0 comments on commit c31a717

Please sign in to comment.