File: when-test.yaml

package info (click to toggle)
crazy-complete 0.3.7-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,528 kB
  • sloc: python: 13,342; sh: 995; makefile: 68
file content (59 lines) | stat: -rw-r--r-- 1,445 bytes parent folder | download
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
prog: "crazy-complete-test"
options:
  - option_strings: ['--option-1']

  - option_strings: ['--option-2']

  - option_strings: ['--if-1-and-2']
    when: 'has_option --option-1 && has_option --option-2'

  - option_strings: ['--if-1-or-2']
    when: 'has_option --option-1 || has_option --option-2'

  - option_strings: ['--if-not-1']
    when: '! has_option --option-1'

  - option_strings: ['--if-not-1-or-not-2']
    when: '! (has_option --option-1 || has_option --option-2)'

---

prog: "crazy-complete-test multiple-when"
options:
  - option_strings: ['--files']

  - option_strings: ['--directories']

  - option_strings: ['--complete']
    complete: ['choices', ['file1', 'file2', 'file3']]
    when: 'has_option --files'

  - option_strings: ['--complete']
    complete: ['choices', ['dir1', 'dir2', 'dir3']]
    when: 'has_option --directories'

positionals:
  - number: 1
    complete: ['choices', ['file1', 'file2', 'file3']]
    when: 'has_option --files'

  - number: 1
    complete: ['choices', ['dir1', 'dir2', 'dir3']]
    when: 'has_option --directories'

---

prog: "crazy-complete-test special-values"
options:
  - option_strings: ['--arg']
    complete: ['none']

  - option_strings: ['--if-arg-is-foo-bar']
    when: 'option_is --arg -- "foo bar"'

  - option_strings: ['--if-arg-is-single-quote']
    when: "option_is --arg -- \"'\""

  - option_strings: ['--if-arg-is-double-quote']
    when: "option_is --arg -- '\"'"