Module Import alias Import alias If CompareEq NameLoad Str body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Dict Str Str Str Str Str BinOpMod Str NameLoad BinOpMod Str NameLoad BinOpMod Str NameLoad BinOpMod Str NameLoad BinOpMod Str NameLoad Assign NameStore Dict Str Str Str Str Str BinOpAdd BinOpAdd Str Call AttributeLoad AttributeLoad NameLoad attr attr Str BinOpAdd Str SubscriptLoad Call AttributeLoad Call AttributeLoad Str attr SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Num Slice Num attr Str Index Num Str Str TryExcept body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str BinOpAdd Str SubscriptLoad Call AttributeLoad Call AttributeLoad Str attr SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Num Slice Num attr Str Index Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str BinOpAdd Str SubscriptLoad Call AttributeLoad Call AttributeLoad Str attr SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Num Slice Num attr Str Index Num Str handlers ExceptHandler type NameLoad name NameStore body Print NameLoad Assign NameStore Dict Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd BinOpAdd ListLoad Str ListComp BinOpMod Str TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr ListComp BinOpMod Str TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad If BoolOpAnd CompareGt Call NameLoad AttributeLoad NameLoad attr Num CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Str body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr
N/A N/A os N/A sys N/A N/A __name__ __main__ N/A N/A cwd N/A N/A sys argv N/A 1 N/A envvars N/A DSHELL DECODERPATH BINPATH LIBPATH DATAPATH N/A %s cwd N/A %s/decoders cwd N/A %s/bin cwd N/A %s/lib cwd N/A %s/share cwd N/A envsetup N/A LD_LIBRARY_PATH PATH PYTHONPATH $LIBPATH:$LD_LIBRARY_PATH $BINPATH:$PATH N/A N/A $DSHELL:$LIBPATH:$LIBPATH/output: N/A N/A N/A os path join $LIBPATH N/A python N/A N/A N/A N/A N/A . join N/A N/A N/A N/A sys version split . 3 N/A 2 split N/A 0 site-packages :$PYTHONPATH N/A N/A N/A N/A N/A os mkdir N/A N/A N/A os path join cwd lib N/A python N/A N/A N/A N/A N/A . join N/A N/A N/A N/A sys version split . 3 N/A 2 split N/A 0 N/A N/A N/A os mkdir N/A N/A N/A os path join cwd lib N/A python N/A N/A N/A N/A N/A . join N/A N/A N/A N/A sys version split . 3 N/A 2 split N/A 0 site-packages N/A N/A N/A Exception N/A e N/A N/A e N/A envdict N/A N/A N/A N/A envdict update envvars N/A N/A N/A envdict update envsetup N/A env N/A N/A N/A export PS1="`whoami`@`hostname`:\w Dshell> " N/A N/A export %s=%s N/A k v N/A N/A k v N/A N/A envvars items N/A N/A export %s=%s N/A k v N/A N/A k v N/A N/A envsetup items N/A outfd N/A open .dshellrc w N/A N/A N/A outfd write N/A N/A join env N/A N/A N/A N/A len N/A sys argv 2 N/A N/A N/A sys argv N/A 2 with_bash_completion N/A N/A N/A N/A outfd write 


if [ `echo $BASH_VERSION | cut -d'.' -f1` -ge '4' ]; then
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

find_decoder()
{
local IFS="+"
for (( i=0; i<${#COMP_WORDS[@]}; i++ ));
do
   if [ "${COMP_WORDS[$i]}" == '-d' ] ; then
        decoders=(${COMP_WORDS[$i+1]})
   fi
done
}

get_decoders()
{
   decoders=$(for x in `find $DECODERPATH -iname '*.py' | grep -v '__init__'`; do basename ${x} .py; done)
}

_decode()
{
local dashdashcommands=' --ebpf --output --outfile --logfile'

local cur prev xspec decoders
COMPREPLY=()
cur=`_get_cword`
_expand || return 0
prev="${COMP_WORDS[COMP_CWORD-1]}"

case "${cur}" in
--*)
    find_decoder
    local options=""
#           if [ -n "$decoders" ]; then
#               for decoder in "${decoders[@]}"
#               do
#                 options+=`/usr/bin/python $BINPATH/gen_decoder_options.py $decoder`
#                 options+=" "
#               done
#           fi

    options+=$dashdashcommands
    COMPREPLY=( $(compgen -W "${options}" -- ${cur}) )
    return 0
    ;;

*+*)
   get_decoders
   firstdecoder=${cur%+*}"+"
   COMPREPLY=( $(compgen -W "${decoders}" -P $firstdecoder -- ${cur//*+}) )
   return 0
   ;;

esac

xspec="*.@(cap|pcap)"
xspec="!"$xspec
case "${prev}" in
-d)
   get_decoders
   COMPREPLY=( $(compgen -W "${decoders[0]}" -- ${cur}) )
   return 0
   ;;

--output)
   local outputs=$(for x in `find $DSHELL/lib/output -iname '*.py' | grep -v 'output.py'`; do basename ${x} .py; done)

   COMPREPLY=( $(compgen -W "${outputs}" -- ${cur}) )
   return 0
   ;;

-F | -o | --outfile | -L | --logfile)
   xspec=
   ;;

esac

COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) $( compgen -d -- "$cur" ) )
}
complete -F _decode -o filenames decode
complete -F _decode -o filenames decode.py
fi
 N/A N/A N/A outfd close N/A outfd N/A open dshell w N/A N/A N/A outfd write #!/bin/bash
 N/A N/A N/A outfd write N/A /bin/bash --rcfile %s/.dshellrc
 cwd N/A N/A N/A outfd close N/A outfd N/A open dshell-decode w N/A N/A N/A outfd write #!/bin/bash
 N/A N/A N/A outfd write N/A source %s/.dshellrc
 cwd N/A N/A N/A outfd write decode "$@" N/A N/A N/A outfd close