File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -162,11 +162,17 @@ In the example we used multiple keys in the metadata dictionary including `help_
162
162
A flag that specifies if the file extension should be removed from the field value.
163
163
Used in order to create an output specification.
164
164
165
-
166
165
`readonly` (`bool ` , default: `False ` ):
167
166
If `True ` the input field can' t be provided by the user but it aggregates other input fields
168
167
(for example the fields with `argstr: - o {fldA} {fldB}` ).
169
168
169
+ `formatter` (`function` ):
170
+ If provided the `argstr` of the field is created using the function. This function can for example
171
+ be used to combine several inputs into one command argument.
172
+ The function can take `field` (this input field will be passed to the function),
173
+ `inputs` (entire `inputs` will be passed) or any input field name
174
+ (a specific input field will be sent).
175
+
170
176
171
177
Validators
172
178
----------
Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ The metadata dictionary for `output_spec` can include:
61
61
`help_string ` (`str `, mandatory):
62
62
A short description of the input field. The same as in `input_spec `.
63
63
64
+ `mandatory ` (`bool `, default: `False `):
65
+ If `True ` the output file has to exist, otherwise an error will be raised.
66
+
64
67
`output_file_template ` (`str `):
65
68
If provided the output file name (or list of file names) is created using the template.
66
69
The template can use other fields, e.g. `{file1} `. The same as in `input_spec `.
@@ -69,11 +72,14 @@ The metadata dictionary for `output_spec` can include:
69
72
If provided the field is added to the output spec with changed name.
70
73
The same as in `input_spec `.
71
74
75
+ `absolute_path ` (`bool ` default: `False `):
76
+ A flag that specifies if the `output_file_template ` is an absolute path. If the flag is not set,
77
+ then the `output_file_template ` is searched in the nodes output directory.
78
+
72
79
`keep_extension ` (`bool `, default: `True `):
73
80
A flag that specifies if the file extension should be removed from the field value.
74
81
The same as in `input_spec `.
75
82
76
-
77
83
`requires ` (`list `):
78
84
List of field names that are required to create a specific output.
79
85
The fields do not have to be a part of the `output_file_template ` and
Original file line number Diff line number Diff line change @@ -2425,7 +2425,7 @@ def formatter_4(field):
2425
2425
2426
2426
2427
2427
def test_shellspec_formatter_splitter_2 (tmpdir ):
2428
- """test the input callable 'formatter'."""
2428
+ """test the input callable 'formatter' when a splitter is used on an argument of the formatter ."""
2429
2429
2430
2430
def spec_info (formatter ):
2431
2431
return SpecInfo (
You can’t perform that action at this time.
0 commit comments