# fusermount completion -*- shell-script -*- proc _fusermount { var cur = '', prev = '', words = '', cword = '' _init_completion || return matchstr $prev { -h|-V|-o { return 0 } -u { global COMPREPLY := '( '$( compgen -W "$( awk \ '{ if ($3 ~ /^fuse(\.|$)/) print $2 }' /etc/mtab \ 2>/dev/null )" -- "$cur" ) ) return 0 } } if [[ "$cur" == -* ]] { global COMPREPLY := '( '$( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) } else { _filedir -d } } && complete -F _fusermount fusermount # ex: ts=4 sw=4 et filetype=sh (CommandList children: [ (AndOr children: [ (FuncDef name: _fusermount body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs:(LhsName name:cur) op:Equal spids:[13]) (assign_pair lhs:(LhsName name:prev) op:Equal spids:[15]) (assign_pair lhs:(LhsName name:words) op:Equal spids:[17]) (assign_pair lhs:(LhsName name:cword) op:Equal spids:[19]) ] spids: [11] ) (AndOr children: [(C {(_init_completion)}) (ControlFlow token:)] op_id: Op_DPipe ) (Case to_match: {($ VSub_Name "$prev")} arms: [ (case_arm pat_list: [{(-h)} {(-V)} {(-o)}] action: [(ControlFlow token: arg_word:{(0)})] spids: [37 42 50 -1] ) (case_arm pat_list: [{(-u)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:COMPREPLY) op: Equal rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(compgen)} {(-W)} { (DQ (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [ {(awk)} { (SQ < "{ if ($3 ~ /^fuse(\\.|$)/) print $2 }" > ) } {(/etc/mtab)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [81] ) ] ) ] ) left_token: spids: [67 84] ) ) } {(--)} {(DQ ($ VSub_Name "$cur"))} ) ] ) left_token: spids: [60 93] ) } ] ) } spids: [57] ) ] spids: [57] ) (ControlFlow token: arg_word: {(0)} ) ] spids: [53 54 103 -1] ) ] spids: [30 34 106] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Name "$cur"))} right: {(-) (Lit_Other "*")} ) ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:COMPREPLY) op: Equal rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(compgen)} {(-W)} {(SQ <"$( _parse_help \"$1\" -h )">)} {(--)} {(DQ ($ VSub_Name "$cur"))} ) ] ) left_token: spids: [133 149] ) } ] ) } spids: [130] ) ] spids: [130] ) ] spids: [-1 127] ) ] else_action: [(C {(_filedir)} {(-d)})] spids: [154 162] ) ] spids: [8] ) spids: [4 7] ) (C {(complete)} {(-F)} {(_fusermount)} {(fusermount)}) ] op_id: Op_DAmp ) ] )