Expand description
Shadow’s configuration and cli parsing code using serde and clap. This contains all of Shadow’s configuration options, some of which are also exposed as CLI options.
Shadow uses schemars to get the option description (its doc comment) and default value so that it can be shown in the CLI help text.
This code should be careful about validating or interpreting values. It should be focused on parsing and checking that the format is correct, and not validating the values. For example for options that take paths, this code should not verify that the path actually exists or perform any path canonicalization. That should be left to other code outside of this module. This is so that the configuration parsing does not become environment-dependent. If a configuration file parses on one system, it should parse successfully on other systems as well.
Structs§
- CliOptions
- Config
File Options - Options contained in a configuration file.
- Config
Options - Shadow configuration options after processing command-line and configuration file options.
- EnvName
- Experimental
Options - File
Source - General
Options - Host
Default Options - Host
Name - Host
Options - Network
Options - Process
Options - Signal
Enums§
- Compression
- Graph
Options - Graph
Source - LogLevel
- Nullable
Option - This wrapper type allows cli options to specify “null” to overwrite a config file option with
None
, and is intended to be used for options where “null” is a valid option value. - Process
Args - Process
Final State - The enum variants here have an extra level of indirection to get the serde serialization that we want.
- QDisc
Mode - Running
Val - Scheduler
- Strace
Logging Mode
Constants§
Traits§
- Flatten
- A trait for
Option
-like types that can be flattened into a singleOption
.
Functions§
- parse_
string_ as_ args - Parses a string as a list of arguments following the shell’s parsing rules. This
uses
g_shell_parse_argv()
for parsing.