File: argparse.out

package info (click to toggle)
fish 3.0.2-2%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,448 kB
  • sloc: ansic: 75,559; cpp: 43,314; sh: 9,096; javascript: 7,710; python: 2,538; makefile: 1,461; objc: 709; perl: 367; xml: 18
file content (131 lines) | stat: -rw-r--r-- 2,455 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

####################
# No args is an error

####################
# Missing -- is an error

####################
# Flags but no option specs is an error

####################
# Invalid option specs

####################
# --max-args and --min-args work

####################
# Invalid "#-val" spec

####################
# Invalid arg in the face of a "#-val" spec

####################
# Defining a short flag more than once

####################
# Defining a long flag more than once

####################
# Defining an implicit int flag more than once

####################
# Defining an implicit int flag with modifiers

####################
# No args

####################
# One arg and no matching flags
argv help

####################
# Five args with two matching a flag
_flag_h '--help'  '-h'
_flag_help '--help'  '-h'
argv 'help'  'me'  'a lot more'

####################
# Required, optional, and multiple flags
_flag_a ABC
_flag_abc ABC
_flag_d
_flag_def
_flag_g 'g1'  'g2'  'g3'
_flag_ghk 'g1'  'g2'  'g3'
_flag_h --help
_flag_help --help
argv 'help'  'me'

####################
# --stop-nonopt works
_flag_a A2
_flag_abc A2
_flag_h -h
_flag_help -h
argv 'non-opt'  'second non-opt'  '--help'

####################
# Implicit int flags work
_flag_val 123
argv 'abc'  'def'
_flag_t woohoo
_flag_token woohoo
_flag_v '-v'  '--verbose'
_flag_val -234
_flag_verbose '-v'  '--verbose'
argv 'a1'  'a2'

####################
# Should be set to 987
_flag_m 987
_flag_max 987
argv 'argle'  'bargle'

####################
# Should be set to 765
_flag_m 765
_flag_max 765
argv 'argle'  'bargle'

####################
# Bool short flag only
_flag_C -C
_flag_v '-v'  '-v'
argv 'arg1'  'arg2'

####################
# Value taking short flag only
_flag_v '--verbose'  '-v'
_flag_verbose '--verbose'  '-v'
_flag_x arg2
argv arg1

####################
# Implicit int short flag only
_flag_v '-v'  '-v'  '-v'
_flag_verbose '-v'  '-v'  '-v'
_flag_x 321
argv 'argle'  'bargle'

####################
# Implicit int short flag only with custom validation passes
_flag_v '-v'  '-v'  '-v'
_flag_verbose '-v'  '-v'  '-v'
_flag_x 499
argv

####################
# Implicit int short flag only with custom validation fails

####################
# Implicit int flag validation fails

####################
# Check the exit status from argparse validation
_flag_name max
_flag_value 83
expected argparse return status 57

####################
# Explicit int flag validation