Skip to content

Instantly share code, notes, and snippets.

Created February 3, 2014 23:44
Show Gist options
  • Save anonymous/8794754 to your computer and use it in GitHub Desktop.
Save anonymous/8794754 to your computer and use it in GitHub Desktop.
#compdef vdbbin
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar <[email protected]>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
# 0. You just DO WHAT THE FUCK YOU WANT TO.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for vdbbin
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Zach Riggle (https://github.com/zachriggle)
#
# ------------------------------------------------------------------------------
local state
_arguments -s -S \
'(- :)'{--help,-h}'[show this help message and exit]' \
'(--cmd -c)'{--cmd,-c}'[debug a fired command]:command:->commands' \
'(--process -p)'{--process,-p}'[attach to a process by name or pid]:pid:->processes' \
'(--qt -Q)'{--qt,-Q}'[run the QT gui]' \
'(--remote -R)'{--remote,-R}'[attach to remote VDB server]:host:_hosts' \
'(--server -S)'{--server,-S}'[run as VDB server]' \
'(--verbose -v)'{--verbose,-v}'[be verbose]' \
'(--snapshot -s)'{--snapshot,-s}'[load a vtrace snapshot file]:snapshot file:_files' \
'(--target -t)'{--target,-t}'[activate special vdb target]' \
'(--android -a)'{--android,-a}'[debug android with adb]' \
'(--eventid -e)'{--eventid,-e}'[used for windows JIT]:event id:' \
&& ret=0
case "$state" in
processes)
_alternative \
'jobs:: _jobs -t' \
'processes:: _pids' \
&& ret=0
;;
commands)
_alternative \
'commands:: _command_names'
;;
esac
return 0
#compdef vivbin
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar <[email protected]>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
# 0. You just DO WHAT THE FUCK YOU WANT TO.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for vivbin
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Zach Riggle (https://github.com/zachriggle)
#
# ------------------------------------------------------------------------------
_arguments -s -S \
'(- :)'{--help,-h}'[show this help message and exit]' \
'(-M)-M[run the file listed as an analysis module in non-gui mode and exit]' \
'(-A)-A[do NOT do an auto-analysis pass]' \
'(-B)-B[bulk mode. do NOT start the gui, just load/analyze/save]' \
'(-C)-C[output vivisect profiling (cProfile) info]' \
'(-O)-O[secname.optname=optval (optval must be JSON)]' \
'(-p)-p[manually select the parser module]:parser:(pe elf blob ihex macho)' \
'(-s)-s[specify storage module by name]' \
'(-v)-v[verbose mode]' \
'(-V)-V[add file version to save file name]'
return 0
#!/usr/bin/env zsh
>>~/.zshrc <<EOF
fpath=($(/bin/readlink -f ${0%/*}) \$fpath)
compinit
EOF
source ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment