examples/whoami/commands/iam.js
function(session, args, callback) {

        // Parse the arguments using optimist
        var argv = optimist.parse(args);

        // Update the environment to indicate who the specified user now is
        session.env('me', argv._[0] || 'unknown');

        // The callback always needs to be invoked to finish the command
        return callback();
    }
function(session, args, callback) {

        // Parse the arguments using optimist
        var argv = optimist.parse(args);

        // Update the environment to indicate who the specified user now is
        session.env('me', argv._[0] || 'unknown');

        // The callback always needs to be invoked to finish the command
        return callback();
    }
function ( session , args , callback ) { // Parse the arguments using optimist var argv = optimist . parse ( args ) ; // Update the environment to indicate who the specified user now is session . env ( 'me' , argv . _ [ 0 ] || 'unknown' ) ; // The callback always needs to be invoked to finish the command return callback ( ) ; }
The function that actually invokes the command. Optimist is being used here to parse the array arguments that were provided to your command, however you can use whatever utility you want
The function that actually invokes the command . Optimist is being used here to parse the array arguments that were provided to your command however you can use whatever utility you want