function onCommand( oldName, newName ) {
		var err;
		if ( !isString( oldName ) ) {
			err = new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', oldName ) );
			debug( 'Error: %s', err.message );
			repl._ostream.write( 'Error: '+err.message+'\n' );
			return;
		}
		if ( !isString( newName ) ) {
			err = new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', newName ) );
			debug( 'Error: %s', err.message );
			repl._ostream.write( 'Error: '+err.message+'\n' );
			return;
		}
		if ( !hasOwnProp( repl._workspaces, oldName ) ) {
			err = new Error( format( 'invalid argument. Unrecognized workspace name. Value: `%s`.', oldName ) );
			debug( 'Error: %s', err.message );
			repl._ostream.write( 'Error: '+err.message+'\n' );
			return;
		}
		if ( oldName === newName ) {
			log( repl, 'Workspace is already named \''+newName+'\'.' );
			return;
		}
		if ( hasOwnProp( repl._workspaces, newName ) ) {
			err = new Error( format( 'invalid argument. Workspace name already exists. Value: `%s`.', newName ) );
			debug( 'Error: %s', err.message );
			repl._ostream.write( 'Error: '+err.message+'\n' );
			return;
		}
		if ( oldName === repl._currentWorkspace ) {
			if ( oldName === 'base' ) {
				repl._workspaces[ 'base' ].length = 0;
				log( repl, 'Created \''+newName+'\' workspace and cleared \'base\' workspace. Current workspace: \''+newName+'\'.' );
				debug( 'Created \'%s\' workspace and cleared \'base\' workspace. Current workspace: \'%s\'.', newName, newName );
			} else {
				delete repl._workspaces[ oldName ];
				log( repl, 'Renamed \''+oldName+'\' workspace to \''+newName+'\'. Current workspace: \''+newName+'\'.' );
				debug( 'Renamed \'%s\' workspace to \'%s\'. Current workspace: \'%s\'.', oldName, newName, newName );
			}
			repl._workspaces[ newName ] = []; // "registers" the workspace
			repl._currentWorkspace = newName; // bookkeeping
			return;
		}
		if ( oldName === 'base' ) {
			repl._workspaces[ newName ] = repl._workspaces[ 'base' ].slice();
			repl._workspaces[ 'base' ].length = 0;
			log( repl, 'Created \''+newName+'\' workspace and cleared \'base\' workspace.' );
			debug( 'Created \'%s\' workspace and cleared \'base\' workspace.', newName );
			return;
		}
		repl._workspaces[ newName ] = repl._workspaces[ oldName ];
		delete repl._workspaces[ oldName ];
		log( repl, 'Renamed \''+oldName+'\' workspace to \''+newName+'\'.' );
		debug( 'Renamed \'%s\' workspace to \'%s\'.', oldName, newName );
	}
Renames a workspace.

@private
@param {string} oldName - name of workspace to rename
@param {string} newName - new workspace name
@returns {void}