Crates.io | app-cli |
lib.rs | app-cli |
version | 0.1.1 |
source | src |
created_at | 2024-06-13 15:49:26.752211 |
updated_at | 2024-06-13 16:16:55.868918 |
description | A short description of my package |
homepage | https://www.github.com/skbhati199/rust_app_cli |
repository | |
max_upload_size | |
id | 1270772 |
size | 13,058 |
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
To register a pet, use the register-pet
subcommand with the required --pet-name
argument.
cargo run -- register-pet --pet-name Fluffy
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
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]
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
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.