       exit "error authenticating" if err
       log 'connected'
       next user, db
- 
+
 exit = (msg) ->
   log msg if msg
   process.exit()


  # check your authentication status
  when 'whoami'
    login (config) ->
      exit JSON.stringify user, null, 2 if config.user
      exit 'not logged in. try "dobi login"'

  # invalid command

  when 'docs'
    open 'http://www.dobi.io'
    exit()

  # show usage
  when 'help'
    exit USAGE
