     logger.trace '%j', par
     request par, (err, resp, body) ->
       logger.error err if err
-      logger.debug body if body.err
+      logger.debug body if body.error
       _.each body.value, (e) ->
         logger.info '%j', _.omit e, ['createdBy', 'lastModifiedBy', 'parentReference']
       callback()
+  wf.exec (err) ->
+
+
+cmdPut = (options) ->
+  logger.debug options
+  wf = wfall.create
+    stream: fs.createReadStream options.localpath
+  wf.push (hooks, callback) ->
+    readToken options, (err, auth) ->
+      hooks.auth = auth
+      callback()
+  wf.push (hooks, callback) ->
+    p = if v = options.path then ':/' + v + ':' else ''
+    par =
+      uri: [options.ROOT, options.user, options.dirve, '/root', encodeURIComponent(p), '/content'].join ''
+      headers:
+        Authorization: 'bearer ' + hooks.auth.access_token
+        'Content-Type': mime.lookup options.localpath
+      method: 'PUT'
+      body: hooks.stream
+    logger.trace '%j', _.omit par, 'body'
+    request par, (err, resp, body) ->
+      logger.error err if err
+      logger.debug body if body.error
+      logger.debug body
   wf.exec (err) ->
 
 

program = require 'commander'
fs      = require 'fs'
wfall   = require 'water-fall'
log4js  = require 'log4js'

logger  = log4js.getLogger()

    json: yes
  request par, (err, resp, body) ->
    fin? err, body


getInput = (callback) ->
