forked from codalab/codalab-worksheets
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rc
33 lines (29 loc) · 1 KB
/
rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Handy macros the CodaLab CLI.
# Usage: clhist <bundle>
# Put the command used to create the bundle in the history.
clhist() {
history -s cl $(cl info -f args $1)
}
clwdiff() {
vimdiff <(cl print -r $1) <(cl print -r $2)
}
# Useful for chaining cl commands.
# Example: cl search .orphan -u | xcl info
alias xcl='xargs cl'
# Activate autocomplete
# If you are using zsh, you will also need to include the following in your .zshrc:
# autoload -U +X compinit && compinit
# autoload -U +X bashcompinit && bashcompinit
# Certain arguments (those that contain colons) do not autocomplete correctly in zsh at the moment.
if [[ -z "${BASH_SOURCE[0]}" ]]; then
# Assume zsh
codalabdir=$(dirname $0)
else
# Assume bash
codalabdir=$(dirname ${BASH_SOURCE[0]})
fi
if [ ! -e "$codalabdir/venv/bin/register-python-argcomplete" ]; then
echo "Could not find register-python-argcomplete script, have you run $codalabdir/setup.sh yet?"
else
eval "$($codalabdir/venv/bin/register-python-argcomplete cl)"
fi