         process.exit(2)
 
     validateGlobalOpts = (opts, commandName) ->
+      validateOpt(opts.parent.mapping, 'mapping', commandName)
+
+    validateCredentialsOpts = (opts, commandName) ->
       validateOpt(opts.parent.projectKey, 'projectKey', commandName)
       validateOpt(opts.parent.clientId, 'clientId', commandName)
       validateOpt(opts.parent.clientSecret, 'clientSecret', commandName)
-      validateOpt(opts.parent.mapping, 'mapping', commandName)
 
     initSftp = (host, username, password, logger) ->
       throw new Error 'You must provide host in order to connect to SFTP' unless host

      .usage '--projectKey <project-key> --clientId <client-id> --clientSecret <client-secret> --mapping <file> --config [file] --products <file>'
      .action (opts) ->

        logger = createLogger(opts)

        if opts.parent.config # use SFTP to load import/export files
          validateOpt(opts.parent.mapping, 'mapping', CONS.CMD_IMPORT_PRODUCTS_UPDATES)
          loadResources(opts, logger)
          .then (resources) ->
            importer = new ProductUpdates resources.options

        utils.readJsonFromPath(opts.parent.mapping)
      .then (mappingResult) ->
        resources.mapping = mappingResult
        utils.readJsonFromPath(opts.parent.sftpCredentials) if opts.parent.sftpCredentials
      .then (sftpCredentialsResult) ->
        sftpCred = {}
        sftpCred = sftpCredentialsResult[opts.parent.projectKey] or {} if sftpCredentialsResult
        {host, username, password} = _.defaults sftpCred,
          host: opts.parent.sftpHost
          username: opts.parent.sftpUsername
          password: opts.parent.sftpPassword
        if not host
          throw new Error "Missing sftp 'host'; --sftpHost: '#{opts.parent.sftpHost}'; --sftpCredentials: '#{opts.parent.sftpCredentials}'; sftpCred: \n #{_u.prettify sftpCred}"
        if not username
          throw new Error "Missing sftp 'username'; --sftpUsername: '#{opts.parent.sftpUsername}'; --sftpCredentials: '#{opts.parent.sftpCredentials}'; sftpCred: \n #{_u.prettify sftpCred}"
        if not password
          throw new Error "Missing sftp 'password'; --sftpPassword: '#{opts.parent.sftpPassword}'; --sftpCredentials: '#{opts.parent.sftpCredentials}'; sftpCred: \n #{_u.prettify sftpCred}"
        resources.sftpClient = initSftp(host, username, password, logger)
        Q(resources)

    processSftpImport = (resources, importer, code) ->
