@@ -365,6 +365,15 @@ fn complete_iamb_space(args: Vec<String>, store: &ChatStore) -> Vec<String> {
365365 }
366366}
367367
368+ /// Tab completion for `:logout`
369+ fn complete_iamb_logout ( args : Vec < String > , store : & ChatStore ) -> Vec < String > {
370+ let id = store. settings . profile . user_id . as_str ( ) ;
371+ match args. len ( ) {
372+ 1 if id. starts_with ( & args[ 0 ] ) => vec ! [ id. to_string( ) ] ,
373+ _ => vec ! [ ] ,
374+ }
375+ }
376+
368377/// Tab completion for command arguments.
369378fn complete_cmdarg (
370379 desc : CommandDescription ,
@@ -404,7 +413,7 @@ fn complete_cmdarg(
404413 "verify" => complete_iamb_verify ( args, store) ,
405414
406415 // These have no arguments
407- "dms" | "members" | "leave" | "cancel" | "edit" => vec ! [ ] ,
416+ "dms" | "members" | "leave" | "forget" | " cancel" | "edit" => vec ! [ ] ,
408417
409418 "react" if args. len ( ) == 1 => complete_emoji ( & args[ 0 ] , store) ,
410419 "react" => vec ! [ ] ,
@@ -417,7 +426,7 @@ fn complete_cmdarg(
417426 "redact" => vec ! [ ] ,
418427
419428 // These have no arguments
420- "reply" | "editor" | "rooms" | "chats" => vec ! [ ] ,
429+ "reply" | "replied" | " editor" | "rooms" | "chats" => vec ! [ ] ,
421430
422431 "unreads" => complete_iamb_unreads ( args) ,
423432
@@ -433,8 +442,24 @@ fn complete_cmdarg(
433442
434443 "space" => complete_iamb_space ( args, store) ,
435444
436- // TODO: replace old options
437- _ => vec ! [ ] ,
445+ "upload" | "download" | "open" => {
446+ * cursor = orig_cursor;
447+ complete_path ( input, cursor)
448+ } ,
449+
450+ "logout" => complete_iamb_logout ( args, store) ,
451+
452+ "vertical" | "vert" | "horizontal" | "hor" | "aboveleft" | "lefta" | "leftabove" |
453+ "abo" | "belowright" | "rightb" | "rightbelow" | "bel" | "tab" => {
454+ complete_cmd ( desc. arg . text . as_str ( ) , input, cursor, store)
455+ } ,
456+
457+ _cmd => {
458+ #[ cfg( test) ]
459+ panic ! ( "trying to complete unknown subcommand `{}`" , _cmd) ;
460+
461+ vec ! [ ]
462+ } ,
438463 } ;
439464
440465 // TODO: escape stuff including with paths
0 commit comments