Skip to content

Commit 1ab4647

Browse files
author
replydev
committed
Help command
1 parent b4c84b8 commit 1ab4647

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/argument_functions.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@ use super::database_loader;
55
use super::cryptograpy;
66
use super::otp_helper;
77

8-
pub fn import(args: Vec<String>){
9-
import_database(&args[2]);
8+
pub fn help(){
9+
println!("ARGUMENTS:");
10+
println!("-a,--add <secret> <issuer> <label> | Add a new OTP code");
11+
println!("-r,--remove <secret> <issuer> <label> | Remove an OTP code");
12+
println!("-e,--edit <id> <secret> <issuer> <label> | Edit an OTP code");
13+
println!("-i,--import <filename> | Import an andOTP backup");
14+
println!("-ex,--export | Export the entire database in a plaintext json format");
15+
println!("-j,--json | Print results in json format");
16+
println!("-h,--help | Print this help");
1017
}
1118

12-
pub fn help(){
13-
println!("Help");
19+
pub fn import(args: Vec<String>){
20+
import_database(&args[2]);
1421
}
1522

1623
pub fn add(args: Vec<String>){
@@ -51,7 +58,7 @@ pub fn edit(args: Vec<String>){
5158
database_loader::edit_element(id, &secret, &issuer, &label).expect("An error occured");
5259
}
5360
else{
54-
println!("Invalid arguments, type cotp --modify <id> <secret> <issuer> <label>\n\nReplace the attribute value with \".\" to skip the attribute modification");
61+
println!("Invalid arguments, type cotp --edit <id> <secret> <issuer> <label>\n\nReplace the attribute value with \".\" to skip the attribute modification");
5562
}
5663
}
5764

0 commit comments

Comments
 (0)