@@ -21,28 +21,28 @@ running it gives. The following snippet templates might help:
21
21
1. Using the CLI function
22
22
23
23
```python
24
- import jsonargparse
24
+ from jsonargparse import CLI
25
25
26
26
# Here define one or more functions or classes
27
27
def func1(param1: int, ...):
28
28
...
29
29
30
30
# Run the CLI providing the components
31
- jsonargparse. CLI([func1, ...], error_handler=None )
31
+ CLI([func1, ...], exit_on_error=False )
32
32
```
33
33
34
34
2. Manually constructing a parser
35
35
36
36
```python
37
- import jsonargparse
37
+ from jsonargparse import ArgumentParser
38
38
39
- parser = jsonargparse. ArgumentParser(error_handler=None )
39
+ parser = ArgumentParser(exit_on_error=False )
40
40
# Here add to the parser only argument(s) relevant to the problem
41
41
42
42
# If a yaml config is required, it can be included in the same snippet as follows:
43
43
import yaml
44
44
45
- parser.add_argument("--config", action=jsonargparse.ActionConfigFile )
45
+ parser.add_argument("--config", action="config" )
46
46
config = yaml.safe_dump(
47
47
{
48
48
"key1": "val1",
@@ -68,7 +68,7 @@ parser.instantiate_classes(result)
68
68
69
69
<!-- Fill in the list below. -->
70
70
71
- - jsonargparse version (e.g., 4.8.0) :
72
- - Python version (e.g., 3.9) :
73
- - How jsonargparse was installed (e.g. ` pip install jsonargparse[all] ` ) :
74
- - OS (e.g., Linux) :
71
+ - jsonargparse version:
72
+ - Python version:
73
+ - How jsonargparse was installed:
74
+ - OS:
0 commit comments