Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 function _mach()
2 {
3 local cur cmds c subcommand
4 COMPREPLY=()
6 # Load the list of commands
7 cmds=`"${COMP_WORDS[0]}" mach-commands`
9 # Look for the subcommand.
10 cur="${COMP_WORDS[COMP_CWORD]}"
11 subcommand=""
12 c=1
13 while [ $c -lt $COMP_CWORD ]; do
14 word="${COMP_WORDS[c]}"
15 for cmd in $cmds; do
16 if [ "$cmd" = "$word" ]; then
17 subcommand="$word"
18 fi
19 done
20 c=$((++c))
21 done
23 if [[ "$subcommand" == "help" || -z "$subcommand" ]]; then
24 COMPREPLY=( $(compgen -W "$cmds" -- ${cur}) )
25 fi
27 return 0
28 }
29 complete -o default -F _mach mach