-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Welcome to the contact-manager wiki!
Phonebook CLI is a command-line application for managing contacts in a phonebook. It supports adding, searching, editing, deleting, and listing contacts. This CLI provides a convenient way to interact with contact data directly from the terminal, making it ideal for quick lookups or modifications.
Phonebook CLI provides a clear set of commands for contact management:
plaintext Копіювати код
Usage: phonebook [-hV] [COMMAND]
This command-line interface manages contacts in a phonebook:
- -h, --help: Show this help message and exit.
- -V, --version: Print version information and exit.
- --user, -u: Selects the active user.
- --add, -a: Adds a new contact to the phonebook.
- --search, -s: Searches for a contact by name.
- --edit, -e: Edits an existing contact by ID.
- --delete, -d: Deletes a contact by ID.
- --list, -ls: Lists all contacts.
Command Details
-
Selects the active user.
Usage: phonebook --user/-u [-hV] [<name>]-
[<name>]: Name to select the user. - Example:
>java -jar phonebook.jar -u alexYou have selected a user: alex
-
-
Adds a new contact to the phonebook.
Usage: phonebook --add/-a [-hV] -n=<name> -e[=<emails> [<emails> [<emails>]]] -p[=<phones> [<phones> [<phones>]]]- -n, --name: Name of the contact.
- -e, --email: Email addresses (can include multiple addresses).
- -p, --phone: Phone numbers (can include multiple numbers).
-
Example:
java -jar phonebook.jar -a -n "John Snow" -p 123456789 22233333 -e 123@qq.ua 234@qq.ua
-
Searches for a contact by name.
Usage: phonebook --search/-s [-hV] [<name>]-
[<name>]: Name to search for. - Example:
>java -jar phonebook.jar -s Chris| ID | FULL NAME | PHONE | EMAIL | | 6728 | Chris Hemsworth | +380671111111, +380672222222 | chris.h@m.ua, chris.h@gmail.com | | 9578 | Chris Pratt | +380673333333, +380674444444 | chris.p@m.ua, chris.p@gmail.com | -
-
Edits a contact by ID.
Usage: phonebook --edit/-e [-hV] [<id>]-
[<id>]: ID of the contact to edit. - Example:
> java -jar phonebook.jar -ls| ID | FULL NAME | PHONE | EMAIL | | 5072 | Chris Hemsworth | +380671111111, +380672222222 | chris.h@m.ua, chris.h@gmail.com | | 335 | Chris Pratt | +380673333333, +380674444444 | chris.p@m.ua, chris.p@gmail.com | | 3790 | Scarlett Johansson | +380675555555, +380676666666 | Scarlett.j@m.ua, Scarlett.j@gmail.com | | 2222 | Jeremy Renner | +380677777777, +380678888888 | Jeremy.r@m.ua, Jeremy.r@gmail.com |> java -jar phonebook.jar -e 2222| ID | FULL NAME | PHONE | EMAIL | | 2222 | Jeremy Renner | +380677777777, +380678888888 | Jeremy.r@m.ua, Jeremy.r@gmail.com |Phone book - select the command:
- Edit name
- Edit phones
- Edit email
- Exit Your choice: > 1
- Enter a new name:
> Jeremy Smit
Contact updated: | ID | FULL NAME | PHONE | EMAIL | | 2222 | Jeremy Smit | +380677777777, +380678888888 | Jeremy.r@m.ua, Jeremy.r@gmail.com | -
-
Deletes a contact by ID.
Usage: phonebook --delete/-d [-hV] [<id>]-
[<id>]: ID of the contact to delete. - Example:
>java -jar phonebook.jar -ls| ID | FULL NAME | PHONE | EMAIL | | 12340 | Chris Hemsworth | +380671111111, +380672222222 | chris.h@m.ua, chris.h@gmail.com | | 12341 | Chris Pratt | +380673333333, +380674444444 | chris.p@m.ua, chris.p@gmail.com | | 12342 | Scarlett Johansson | +380675555555, +380676666666 | Scarlett.j@m.ua, Scarlett.j@gmail.com | | 12343 | Jeremy Renner | +380677777777, +380678888888 | Jeremy.r@m.ua, Jeremy.r@gmail.com>java -jar phonebook.jar -d 12341 12342Contact deleted: | ID | FULL NAME | PHONE | EMAIL | | 12340 | Chris Hemsworth | +380671111111, +380672222222 | chris.h@m.ua, chris.h@gmail.com | | 12343 | Jeremy Renner | +380677777777, +380678888888 | Jeremy.r@m.ua, Jeremy.r@gmail.com -
-
Lists all contacts.
Usage: phonebook --list/-ls [-hV]- Example:
> java -jar phonebook.jar -ls| ID | FULL NAME | PHONE | EMAIL | | 5072 | Chris Hemsworth | +380671111111, +380672222222 | chris.h@m.ua, chris.h@gmail.com | | 335 | Chris Pratt | +380673333333, +380674444444 | chris.p@m.ua, chris.p@gmail.com | | 3790 | Scarlett Johansson | +380675555555, +380676666666 | Scarlett.j@m.ua, Scarlett.j@gmail.com | | 2222 | Jeremy Renner | +380677777777, +380678888888 | Jeremy.r@m.ua, Jeremy.r@gmail.com |
- Programming Language: Java
- Frameworks: [To be determined]
- Dependencies:
- Database: To be determined
- Database: [To be determined]
- Build Tools: IntelliJ IDEA, Maven
- Main Author: JavaRush GNEW
-
Contributors:
- BevzyukIvan13 - BevzyukIvan
- Denys Burduzhan - DenysBurduzhan
- Evgenii - DevEvge
- Sergiy Kachan - dRaider-bitrek
- hrsweetlana - hrsweetlana
- oleksandr-jr - oleksandr-jr
- Antonina Z - tojnya