Skip to content
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

Add --ignore-config option #633

Closed
phihag opened this issue Jan 12, 2013 · 1 comment
Closed

Add --ignore-config option #633

phihag opened this issue Jan 12, 2013 · 1 comment

Comments

@phihag
Copy link
Contributor

phihag commented Jan 12, 2013

There should be an option to ignore configuration files. Do something sensible if it occurs in a configuration file.

@jaimeMF
Copy link
Collaborator

jaimeMF commented Jan 12, 2013

I would suggest to use something similar to #632, but parsing first sys.argv and only parsing the config files if --ignore-config is not given:

default_settings = {'template': '%(id)s.%(ext)s'}
settings = default_settings.copy()
cmdargs=parseArgs(sys.argv)
if not ignore_config in cmdargs:
    args = readArgs('/etc/youtube-dl.conf')
    settings.update(parseArgs(args, errmsg='invalid system configuration'))
    args = readArgs('~/.config/youtube-dl.conf')
    settings.update(parseArgs(args, errmsg='invalid user configuration'))
settings.update(cmdargs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants