Browse Source

Add configuration to -v output

Philipp Hagemeister 12 years ago
parent
commit
8c42c506cd
1 changed files with 11 additions and 3 deletions
  1. 11 3
      youtube_dl/__init__.py

+ 11 - 3
youtube_dl/__init__.py

@@ -274,12 +274,20 @@ def parseOpts():
 
 
     xdg_config_home = os.environ.get('XDG_CONFIG_HOME')
     xdg_config_home = os.environ.get('XDG_CONFIG_HOME')
     if 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:
     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)
     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
     return parser, opts, args
 
 
 def _real_main():
 def _real_main():