tasks/dock.js
function(command, arg) {
    if (!arg) {
      arg = 'default';
    }

    if (!commands[command]) {
      grunt.fail.fatal('Command [' + command + '] not found.');
    }

    // Check arg
    if (typeof (commands[command]) !== 'function') {
      if (!commands[command][arg]) {
        grunt.fail.fatal('Argument [' + arg + '] for [' + command
            + '] not found.');
      }
    }

    var func = (arg) ? commands[command][arg] : commands[command];
    if (!func) {
      func = commands[command]; // fallback to the main function
    }

    var options = this.options();
    var docker = (options.docker) ? new Docker(options.docker) : null;
    var done = this.async();

    var callback = function(e) {
      if (e) {
        grunt.fail.warn(e);
      }
      done();
    };

    func.apply(this, [ grunt, docker, options, callback, arg ]);
  }
function(command, arg) {
    if (!arg) {
      arg = 'default';
    }

    if (!commands[command]) {
      grunt.fail.fatal('Command [' + command + '] not found.');
    }

    // Check arg
    if (typeof (commands[command]) !== 'function') {
      if (!commands[command][arg]) {
        grunt.fail.fatal('Argument [' + arg + '] for [' + command
            + '] not found.');
      }
    }

    var func = (arg) ? commands[command][arg] : commands[command];
    if (!func) {
      func = commands[command]; // fallback to the main function
    }

    var options = this.options();
    var docker = (options.docker) ? new Docker(options.docker) : null;
    var done = this.async();

    var callback = function(e) {
      if (e) {
        grunt.fail.warn(e);
      }
      done();
    };

    func.apply(this, [ grunt, docker, options, callback, arg ]);
  }
function ( command , arg ) { if ( ! arg ) { arg = 'default' ; } if ( ! commands [ command ] ) { grunt . fail . fatal ( 'Command [' + command + '] not found.' ) ; } // Check arg if ( typeof ( commands [ command ] ) !== 'function' ) { if ( ! commands [ command ] [ arg ] ) { grunt . fail . fatal ( 'Argument [' + arg + '] for [' + command + '] not found.' ) ; } } var func = ( arg ) ? commands [ command ] [ arg ] : commands [ command ] ; if ( ! func ) { func = commands [ command ] ; // fallback to the main function } var options = this . options ( ) ; var docker = ( options . docker ) ? new Docker ( options . docker ) : null ; var done = this . async ( ) ; var callback = function ( e ) { if ( e ) { grunt . fail . warn ( e ) ; } done ( ) ; } ; func . apply ( this , [ grunt , docker , options , callback , arg ] ) ; }
Process the given command with arg.
Process the given command with arg .