File: library.exp

package info (click to toggle)
monotone 1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 20,648 kB
  • sloc: cpp: 86,443; sh: 6,906; perl: 924; makefile: 838; python: 517; lisp: 379; sql: 118; exp: 91; ansic: 52
file content (40 lines) | stat: -rw-r--r-- 1,204 bytes parent folder | download | duplicates (3)
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
34
35
36
37
38
39
40
# Functions and starter for the bash completion tests

proc success {} {
    send_user "\n<<success>>\n"
}

proc failure {str} {
    if {$str == ""} {
	send_user "\n<<failure>>\n"
    } else {
	send_user "\n<<failure: $str>>\n"
    }
}

# Escape characters that are legal in filenames, but which have
# special meaning for bash - including spaces. Feel free to add
# allowed characters. Note that forward and back slashes are allowed,
# because we escape the entire paths, including path separators.
proc escape {str} {
    regsub -all {[^[:alnum:]_/\-\!\(\)\.\\]} $str {\\&}
}

set timeout 2
set env(initial_dir) $initial_dir
set env(srcdir) $srcdir
# some user's ~/.bash_profile start xserver etc; don't do that
spawn "bash" "--init-file" "/dev/null" "--rcfile" "bashrc"
# If there is no completion package, it's no point trying this.
# Make sure we do get a prompt.
expect {
    -timeout 200
    timeout { failure "no prompt"; exit }
    "No bash completion package present." {
	failure "No bash completion package present."; exit
    }
    -re "@ $"
}
send ". [escape $initial_dir]/extra/shell/monotone.bash_completion\n"
# Wait for the last line to be echoed
expect "shell/monotone.bash_completion"