1 unstable release

0.1.1 Jun 13, 2024
0.1.0 Jun 13, 2024

#188 in Cargo plugins

MIT license

6KB

Here's a README.md file for your project using the app-cli crate:

# Command-Line Application with `app-cli`

This Rust application demonstrates the use of the `app-cli` crate for building a command-line interface (CLI). The application allows users to register a person or a pet with specific command-line arguments.

## Features

- Register a person with first and last name.
- Register a pet with a pet name.
- Optional flag to indicate if the person is wearing a fluffy coat.

## Usage

### Register a Person

To register a person, use the `register-person` subcommand with the required `--first-name` (or aliases `-f`, `--fname`, `--firstname`) and `--last-name` (or aliases `-l`, `--lname`, `--lastname`) arguments.

```bash
cargo run -- register-person --first-name John --last-name Doe

or using the short aliases:

cargo run -- register-person -f John -l Doe

Register a Pet

To register a pet, use the register-pet subcommand with the required --pet-name argument.

cargo run -- register-pet --pet-name Fluffy

Optional Arguments

The --fluffy argument can be used with any subcommand to indicate if the person is wearing a fluffy coat.

cargo run -- register-person --first-name John --last-name Doe --fluffy

Installation

To run this application, you need to have Rust installed on your system. If you don't have Rust installed, you can get it from rust-lang.org.

Clone the repository and navigate to the project directory:

git clone https://github.com/skbhati199/rust_app_cli
cd rust_app_cli

Build the project:

cargo build

Run the project:

cargo run -- <subcommand> [options]

Example

Register a person named John Doe:

cargo run -- register-person --first-name John --last-name Doe

Output:

First Name : John Last name: Doe

Register a pet named Fluffy:

cargo run -- register-pet --pet-name Fluffy

License

This project is licensed under the MIT License - see the LICENSE file for details.


This `README.md` provides an overview of the application, how to use it, and example commands to get started. Adjust the `https://github.com/skbhati199/rust_app_cli` and `rust_app_cli` placeholders to match your actual repository details.

Dependencies

~1MB
~15K SLoC