# ionice(1) completion -*- shell-script -*- # Use of this file is deprecated. Upstream completion is available in # util-linux >= 2.23, use that instead. proc _ionice { var cur = '', prev = '', words = '', cword = '' _init_completion || return var offset = '0', i = '' for (( i=1; i <= cword; i++ )); do case ${words[i]} in -h) return ;; -p) offset=0 break ;; -c|-n) (( i++ )) continue ;; -*) continue ;; esac offset=$i break done if [[ $offset -gt 0 ]] { _command_offset $offset return } matchstr $prev { -c { global COMPREPLY := '( '$( compgen -W '{0..3}' -- "$cur" ) ) return } -n { global COMPREPLY := '( '$( compgen -W '{0..7}' -- "$cur" ) ) return } -p { _pids return } } if [[ $cur == -* ]] { global COMPREPLY := '( '$( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) return } } && complete -F _ionice ionice # ex: ts=4 sw=4 et filetype=sh (CommandList children: [ (AndOr children: [ (FuncDef name: _ionice body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs:(LhsName name:cur) op:Equal spids:[20]) (assign_pair lhs:(LhsName name:prev) op:Equal spids:[22]) (assign_pair lhs:(LhsName name:words) op:Equal spids:[24]) (assign_pair lhs:(LhsName name:cword) op:Equal spids:[26]) ] spids: [18] ) (AndOr children: [(C {(_init_completion)}) (ControlFlow token:)] op_id: Op_DPipe ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:offset) op: Equal rhs: {(0)} spids: [39] ) (assign_pair lhs:(LhsName name:i) op:Equal spids:[42]) ] spids: [37] ) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{(Lit_Digits 1)}) ) cond: (ArithBinary op_id: Arith_LessEqual left: (ArithVarRef name:i) right: (ArithVarRef name:cword) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) body: (DoGroup children: [ (Case to_match: { (BracedVarSub token: bracket_op: (ArrayIndex expr:(ArithVarRef name:i)) spids: [73 78] ) } arms: [ (case_arm pat_list: [{(-h)}] action: [(ControlFlow token:)] spids: [83 84 90 -1] ) (case_arm pat_list: [{(-p)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:offset) op: Equal rhs: {(0)} spids: [97] ) ] spids: [97] ) (ControlFlow token: ) ] spids: [93 94 104 -1] ) (case_arm pat_list: [{(-c)} {(-n)}] action: [ (DParen child: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) ) (ControlFlow token: ) ] spids: [107 110 125 -1] ) (case_arm pat_list: [{(-) (Lit_Other "*")}] action: [(ControlFlow token:)] spids: [128 130 136 -1] ) ] spids: [71 80 139] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:offset) op: Equal rhs: {($ VSub_Name "$i")} spids: [142] ) ] spids: [142] ) (ControlFlow token:) ] spids: [68 149] ) ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_gt left: {($ VSub_Name "$offset")} right: {(0)} ) ) terminator: ) ] action: [ (C {(_command_offset)} {($ VSub_Name "$offset")}) (ControlFlow token:) ] spids: [-1 166] ) ] spids: [-1 177] ) (Case to_match: {($ VSub_Name "$prev")} arms: [ (case_arm pat_list: [{(-c)}] 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 <"{0..3}">)} {(--)} {(DQ ($ VSub_Name "$cur"))} ) ] ) left_token: spids: [195 211] ) } ] ) } spids: [192] ) ] spids: [192] ) (ControlFlow token:) ] spids: [188 189 219 -1] ) (case_arm pat_list: [{(-n)}] 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 <"{0..7}">)} {(--)} {(DQ ($ VSub_Name "$cur"))} ) ] ) left_token: spids: [229 245] ) } ] ) } spids: [226] ) ] spids: [226] ) (ControlFlow token:) ] spids: [222 223 253 -1] ) (case_arm pat_list: [{(-p)}] action: [(C {(_pids)}) (ControlFlow token:)] spids: [256 257 266 -1] ) ] spids: [181 185 269] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ 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: [293 309] ) } ] ) } spids: [290] ) ] spids: [290] ) (ControlFlow token:) ] spids: [-1 287] ) ] spids: [-1 317] ) ] spids: [15] ) spids: [11 14] ) (C {(complete)} {(-F)} {(_ionice)} {(ionice)}) ] op_id: Op_DAmp ) ] )