 
   program.command 'auth'
     .description 'show auth uri && wait for {code} from stdin'
+    .option '--client_id <value>'
+    .option '--client_secret <value>'
     .option '-a --authinfo <filename>', 'save auth-info'
     .action (options) ->
-      cmdAuth _.extend {}, options, defaultOptions
+      par = _.extend {}, defaultOptions, _.pick options, ['client_id', 'client_secret'].concat _.keys defaultOptions
+      cmdAuth par
 
   program.command 'show <res>'
     .description 'show list/drive'


cmdAuth = (options) ->
  wf = wfall.create
    open: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=#{client_id}&scope=#{encodeURIComponent scope}&response_type=code&redirect_uri=#{encodeURIComponent redirect_uri}"
  wf.push (hooks, callback) ->
    console.log "OPEN", hooks.open
    getInput (err, code) ->
      hooks.code = code
      callback()
  wf.push (hooks, callback) ->
    getToken hooks.code, (err, auth) ->
      hooks.auth = auth
      callback()
  wf.push (hooks, callback) ->
    console.log hooks.auth



cmdPut = (options) ->
  wf = wfall.create
    stream: fs.createReadStream options.localpath
  wf.push (hooks, callback) ->
