So I took a look at this function again and I think I understand what you're doing a little better now. So this "args" you mention that you need as far as I can tell all you use it for is the youtube.authenticate() function, having a look at that function I can see you actually did document the YouTube part of the arguments which I missed because I was reading this from the perspective of the upload() function.

So this function performs 2 operations as far as I can tell.

1. Authenticates with YouTube
2. Uploads the file(s)

To be honest I think this function does too many things. My suggestion is to refactor this command to 2 parts. Keep the upload() and create a new function authenticate() which will do the authentication step. The user would setup authentication once and every time in the future the uploader should read in the authentication configuration from the config file or similar.

<pre>
freeseer upload youtube authenticate <params>  # one time authentication setup required
freeseer upload youtube files <file/directory>       # The file or directory
</pre>

I think upload() function would then only have 1 parameter "files" since this seems to be all you're using to upload anyway. The configuration will be imported to the service from configuration. (From what I can tell you're already doing that anyway... in your get_defaults())

The new authenticate() function will then do what you were doing before with the parsing of args().

Does this make sense?