app-cli

Crates.ioapp-cli
lib.rsapp-cli
version0.1.1
sourcesrc
created_at2024-06-13 15:49:26.752211
updated_at2024-06-13 16:16:55.868918
descriptionA short description of my package
homepagehttps://www.github.com/skbhati199/rust_app_cli
repository
max_upload_size
id1270772
size13,058
Sonu Kumar (skbhati199)

documentation

https://www.github.com/skbhati199/rust_app_cli

README

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.
Commit count: 0

cargo fmt