-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
cli: make config based args available during early setup #3255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Sounds reasonable. Regarding tests, I don't think we have one for |
Is it a breaking change? It's broken right now... you cannot use some of the command line options from the config file, it was always the intention to be able to set them via config.
We do have some tests, but nothing that covers config loading. |
won't work if you use plugin commands with "first available default config"
streamlink/src/streamlink_cli/main.py Lines 681 to 684 in ce8e4e2
|
As arguments can be loaded from a config file these need to be loaded as soon as possible otherwise some options will not have the desired effect. For example, `quiet` can be specified in `.streamlinkrc`, however it will not take effect. With this change the default config args are loaded earlier, however plugin specific config files are still loaded later. Options that will take effect from the config file now include: - `loglevel` - `json` - `stream_url` - `subprocess-cmdline` - `quiet` - `stdout` - `output` - `record-and-pipe` - `plugins-dir` The plugin specific config option behaviour remains unchanged, and `loglevel` is the only option that is affected.
ce8e4e2
to
55788af
Compare
@back-to easily fixed. |
…3255) As arguments can be loaded from a config file these need to be loaded as soon as possible otherwise some options will not have the desired effect. For example, `quiet` can be specified in `.streamlinkrc`, however it will not take effect. With this change the default config args are loaded earlier, however plugin specific config files are still loaded later. Options that will take effect from the config file now include: - `loglevel` - `json` - `stream_url` - `subprocess-cmdline` - `quiet` - `stdout` - `output` - `record-and-pipe` - `plugins-dir` The plugin specific config option behaviour remains unchanged, and `loglevel` is the only option that is affected.
As arguments can be loaded from a config file these need to be loaded as soon as possible otherwise some options will not have the desired effect. For example,
quiet
can be specified in.streamlinkrc
, however it will not take effect. With this change the default config args are loaded earlier, however plugin specific config files are still loaded later.Options that will take effect from the config file now include:
loglevel
**json
stream_url
subprocess-cmdline
quiet
stdout
output
record-and-pipe
plugin-dirs
The plugin specific config option behaviour remains unchanged, and
loglevel
is the only option that is affected.I do not think it is possible to sensibly load the plugin specific options early, there are too many opportunities for errors. I noticed this was not working as expected because
plugin-dirs
was not being set from the config file and is the primary reason for this fix.setup_args
is also called twice, and the way I see itsetup_config_args
should have been called twice as well, assetup_args
only does half the job.**
loglevel
is slightly different, it would take affect, but only after the initial setup had been completed. This means that if there weredebug
log messages during the setup they would not have been logged unlessloglevel
was set on the command line.