11# Command Line Interface
22
33After installation, the ` xrlint ` command can be used from the terminal.
4- The following are the command's options and arguments:
4+ The following are the command's usage help including a short description
5+ of its options and arguments:
56
67```
78Usage: xrlint [OPTIONS] [FILES]...
89
910 Validate the given dataset FILES.
1011
11- Reads configuration from './xrlint_config.*' if such file exists and unless
12- '--no_config_lookup' is set or '--config' is provided. It then validates
13- each dataset in FILES against the configuration. The default dataset patters
14- are '**/*.zarr' and '**/.nc'. FILES may comprise also directories or URLs.
15- The supported URL protocols are the ones supported by xarray. Using remote
16- protocols may require installing additional packages such as S3Fs
17- (https://s3fs.readthedocs.io/) for the 's3' protocol.
12+ When executed, XRLint does the following three things:
1813
19- If a directory is provided that not matched by any file pattern, it will be
20- traversed recursively. The validation result is dumped to standard output if
21- not otherwise stated by '--output-file'. The output format is 'simple' by
22- default. Other inbuilt formats are 'json' and 'html' which you can specify
23- using the '--format' option.
14+ (1) Unless options '--no-config-lookup' or '--config' are used it searches
15+ for a default configuration file in the current working directory. Default
16+ configuration files are determined by their filename, namely
17+ 'xrlint_config.py' or 'xrlint-config.<format>', where <format> refers to the
18+ filename extensions 'json', 'yaml', and 'yml'. A Python configuration file
19+ ('*.py'), is expected to provide XRLInt configuration from a function
20+ 'export_config()', which may include custom plugins and rules.
21+
22+ (2) It then validates each dataset in FILES against the configuration. The
23+ default dataset patters are '**/*.zarr' and '**/.nc'. FILES may comprise
24+ also directories or URLs. The supported URL protocols are the ones supported
25+ by xarray. Using remote protocols may require installing additional packages
26+ such as S3Fs (https://s3fs.readthedocs.io/) for the 's3' protocol. If a
27+ directory is provided that not matched by any file pattern, it will be
28+ traversed recursively.
29+
30+ (3) The validation result is dumped to standard output if not otherwise
31+ stated by '--output-file'. The output format is 'simple' by default. Other
32+ inbuilt formats are 'json' and 'html' which you can specify using the '--
33+ format' option.
34+
35+ Please refer to the documentation (https://bcdev.github.io/xrlint/) for more
36+ information.
2437
2538Options:
26- --no-config-lookup Disable use of default configuration from
27- xrlint_config.*
28- -c, --config FILE Use this configuration, overriding xrlint_config.*
29- config options if present
39+ --no-config-lookup Disable use of default configuration files
40+ -c, --config FILE Use this configuration instead of looking for a
41+ default configuration file
3042 --print-config FILE Print the configuration for the given file
3143 --plugin MODULE Specify plugins. MODULE is the name of Python module
3244 that defines an 'export_plugin()' function.
@@ -37,7 +49,9 @@ Options:
3749 --color / --no-color Force enabling/disabling of color
3850 --max-warnings COUNT Number of warnings to trigger nonzero exit code -
3951 default: 5
40- --init Write initial configuration file and exit.
52+ --init Write initial configuration file 'xrlint-
53+ config.yaml' and exit.
4154 --version Show the version and exit.
4255 --help Show this message and exit.
56+
4357```
0 commit comments