A command-line interface for managing employee assignments within a company, implemented in Rust. This tool allows users to add employees to departments and retrieve sorted lists of employees.
- Add Employee: Add employees to departments with commands like
Add [Employee name] to [department name]
. - Show Employees: Retrieve a comma-separated list of employees in a specified department with commands like
Show [department name]
. - Interactive CLI: User-friendly text interface for managing and displaying employee data.
Welcome to an employee manager!
Use two types of commands:
"Add [Employee name] to [department name]" ===> Example: "Add Amir to Sales"
OR
"Show [department name]" ===> Example: "Show [department name]"
OR
"Exit"
Please enter a command:
Add Sasha to QA
Employee "Sasha" is added to "QA"
Please enter a command:
Add Alex to QA
Employee "Alex" is added to "QA"
Please enter a command:
Show QA
Sasha, Alex
Please enter a command:
exit
Goodbye!
To build and run this project, ensure you have Rust installed. You can then use Cargo to manage and run the project:
cargo build
cargo run
Run the application and follow the on-screen instructions. Here are some example commands you can use:
- Add an employee:
Add [Employee name] to [department name]
- Example:
Add Amir to Sales
- Example:
- Show employees:
Show [department name]
- Example:
Show Sales
- Example:
- Exit: Type
Exit
to close the application.
cargo test
The tests cover various aspects of the functionality, including command parsing and employee management.
This project is licensed under the MIT License. See the LICENSE file for details.