File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ fn main() -> Result<()> {
3434 )
3535 . subcommand (
3636 Command :: new ( "add" )
37+ . about ( "Manually add a contacts email id and full name." )
38+ . arg ( Arg :: new ( "email" ) . required ( true ) )
39+ . arg ( Arg :: new ( "fullname" ) ) ,
40+ )
41+ . subcommand (
42+ Command :: new ( "add-email" )
3743 . about ( "Take mail from stdin, add sender to contacts. Print filename." ) ,
3844 )
3945 . subcommand (
@@ -73,7 +79,14 @@ fn main() -> Result<()> {
7379 cli:: email_query ( & config, value) ?
7480 }
7581 }
76- Some ( ( "add" , _) ) => {
82+ Some ( ( "add" , args) ) => {
83+ let contact = utils:: Contact :: generate (
84+ args. value_of ( "fullname" ) ,
85+ args. value_of ( "email" ) ,
86+ & config. vdir_path ) ;
87+ contact. write_create ( ) ?;
88+ }
89+ Some ( ( "add-email" , _) ) => {
7790 let stdin = io:: stdin ( ) ;
7891 let mut email = String :: new ( ) ;
7992 stdin. lock ( ) . read_to_string ( & mut email) ?;
You can’t perform that action at this time.
0 commit comments