diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-03-12 00:10:05 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-03-12 00:10:05 +0100 |
commit | 8c42c506cdaab6f8e1cc65a2f3f2f756188a68fe (patch) | |
tree | a81ae27041db48da5a218d1a3815e2d5a1172f45 /youtube_dl | |
parent | 3d3423574d35a0fe71062f21dd57ada02a5225b4 (diff) |
Add configuration to -v output
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/__init__.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 3983e2f0e..8a7aab7ac 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -274,12 +274,20 @@ def parseOpts(): xdg_config_home = os.environ.get('XDG_CONFIG_HOME') if xdg_config_home: - userConf = os.path.join(xdg_config_home, 'youtube-dl.conf') + userConfFile = os.path.join(xdg_config_home, 'youtube-dl.conf') else: - userConf = os.path.join(os.path.expanduser('~'), '.config', 'youtube-dl.conf') - argv = _readOptions('/etc/youtube-dl.conf') + _readOptions(userConf) + sys.argv[1:] + userConfFile = os.path.join(os.path.expanduser('~'), '.config', 'youtube-dl.conf') + systemConf = _readOptions('/etc/youtube-dl.conf') + userConf = _readOptions(userConfFile) + commandLineConf = sys.argv[1:] + argv = systemConf + userConf + commandLineConf opts, args = parser.parse_args(argv) + if opts.verbose: + print(u'[debug] System config: ' + repr(systemConf)) + print(u'[debug] User config: ' + repr(userConf)) + print(u'[debug] Command-line args: ' + repr(commandLineConf)) + return parser, opts, args def _real_main(): |