function command( repl ) {
	return onCommand;

	/**
	* Deletes user-defined variables in a specified workspace.
	*
	* @private
	* @param {string} [name] - workspace name
	* @param {Options} [options] - function options
	* @param {(RegExp|ArrayLikeObject)} [options.include] - name inclusion filter
	* @param {(RegExp|ArrayLikeObject)} [options.exclude] - name exclusion filter
	* @returns {void}
	*/
	function onCommand( name, options ) {
		var isArrInc;
		var isArrExc;
		var opts;
		var list;
		var desc;
		var err;
		var tmp;
		var n;
		var d;
		var i;

		if ( arguments.length === 0 ) {
			n = repl._currentWorkspace;
			opts = {};
		} else if ( arguments.length === 1 ) {
			if ( isString( name ) ) {
				n = name;
				opts = {};
			} else if ( isPlainObject( name ) ) {
				n = repl._currentWorkspace;
				opts = name;
			} else {
				err = new TypeError( format( 'invalid argument. Must provide either an options object or a workspace name. Value: `%s`.', name ) );
				debug( 'Error: %s', err.message );
				repl._ostream.write( 'Error: '+err.message+'\n' );
				return;
			}
		} else {
			if ( !isString( name ) ) {
				err = new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', name ) );
				debug( 'Error: %s', err.message );
				repl._ostream.write( 'Error: '+err.message+'\n' );
				return;
			}
			n = name;
			if ( !isPlainObject( options ) ) {
				err = new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', name ) );
				debug( 'Error: %s', err.message );
				repl._ostream.write( 'Error: '+err.message+'\n' );
				return;
			}
			opts = options;
		}
		if ( hasOwnProp( opts, 'include' ) ) {
			isArrInc = isArrayLike( opts.include );
			if ( isArrInc === false && !isRegExp( opts.include ) ) {
				err = new TypeError( format( 'invalid option. `%s` option must be a regular expression or an array-like object. Option: `%s`.', 'include', opts.include ) );
				debug( 'Error: %s', err.message );
				repl._ostream.write( 'Error: '+err.message+'\n' );
				return;
			}
		}
		if ( hasOwnProp( opts, 'exclude' ) ) {
			isArrExc = isArrayLike( opts.exclude );
			if ( isArrExc === false && !isRegExp( opts.exclude ) ) {
				err = new TypeError( format( 'invalid option. `%s` option must be a regular expression or an array-like object. Option: `%s`.', 'exclude', opts.include ) );
				debug( 'Error: %s', err.message );
				repl._ostream.write( 'Error: '+err.message+'\n' );
				return;
			}
		}
		if ( n === repl._currentWorkspace ) {
			// Get the current variable list:
			tmp = repl._context.varsWorkspace( n, {} );
			if ( tmp.length === 0 ) {
				// No user-defined variables to delete...
				log( repl, 'No user-defined variables to delete.' );
				debug( 'No user-defined variables to delete.' );
				return;
			}
			// Cache the variable names and their respective property descriptors:
			list = [];
			for ( i = 0; i < tmp.length; i++ ) {
				list.push( tmp[ i ], propertyDescriptor( repl._context, tmp[i] ) ); // eslint-disable-line max-len
			}
			d = list.length / 2;

			// Filter the list of variables:
			list = filter( list, opts.include, isArrInc, opts.exclude, isArrExc ); // eslint-disable-line max-len

			// Reset the REPL evaluation context (Why? Because we cannot simply delete variables as seen within the REPL environment. E.g., variables declared with `var` in the global scope are non-configurable, and, thus, cannot be deleted (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete). While we can delete a property/variable from the REPL context object here, this deletion does not get propagated to within the REPL environment; i.e., a user can still access the deleted property as a variable within the REPL environment. Hence, we need to adopt a cache, reset, and reassign approach, as done here.):
			repl.resetContext(); // Note: in sandboxed environments, we assume a fresh context object is created!

			// Reassign the variables which were not deleted:
			for ( i = 0; i < list.length; i += 2 ) {
				desc = list[ i+1 ];
				if ( desc.configurable || repl._sandbox ) {
					// If configurable, in non-sandboxed environments, we simply overwrite the existing descriptor; in sandboxed environments, we always need to redefine the variable with the appropriate property descriptor; if non-configurable, in non-sandboxed environments, we do not need to reassign/redefine, as the variable could not be deleted from the context object and thus already exists and cannot be reconfigured:
					defineProperty( repl._context, list[ i ], desc );
				}
			}
			d -= list.length / 2;
			log( repl, 'Deleted '+d+' variable(s).' );
			debug( 'Deleted %d variable(s).', d );
			return;
		}
		if ( !hasOwnProp( repl._workspaces, n ) ) {
			err = new Error( format( 'invalid argument. Unrecognized workspace name. Value: `%s`.', n ) );
			debug( 'Error: %s', err.message );
			repl._ostream.write( 'Error: '+err.message+'\n' );
			return;
		}
		list = repl._workspaces[ n ];

		// Case: clear all user-defined variables...
		if ( opts.include === void 0 && opts.exclude === void 0 ) {
			list.length = 0;
			log( repl, 'Deleted '+d+' variable(s).' );
			debug( 'Deleted %d variable(s).', d );
			return;
		}
		// Case: include/exclude filters:
		list = filter( list, opts.include, isArrInc, opts.exclude, isArrExc );
		d -= list.length / 2;
		log( repl, 'Deleted '+d+' variable(s).' );
		debug( 'Deleted %d variable(s).', d );
	}
}
Returns a callback to be invoked upon calling the `clearWorkspace` command.

@private
@param {REPL} repl - REPL instance
@returns {Function} callback