function onCommand() {
		var action;
		var nargs;
		var keys;

		nargs = arguments.length;
		if ( nargs === 0 ) {
			repl._ostream.write( 'Error: invalid argument. First argument must be an action name.\n' );
			return;
		}
		action = arguments[ 0 ];
		if ( nargs === 1 ) {
			if ( !isString( action ) ) {
				repl._ostream.write( format( 'Error: invalid argument. First argument must be a string. Value: `%s`.\n', action ) );
				return;
			}
			if ( !isAction( action ) ) {
				repl._ostream.write( format( 'Error: invalid argument. First argument must be a valid action name. Value: `%s`.\n', action ) );
				return;
			}
			repl._ostream.write( 'Listening for keypresses...' );
			repl._isCapturingKeybinding = true;
			repl._targetAction = action;
			return;
		}
		keys = arguments[ 1 ];
		try {
			repl.setKeybinding( action, keys );
			repl._ostream.write( format( '\nSuccessfully set keybindings for action `%s`.\n', action ) );
		} catch ( err ) {
			repl._ostream.write( format( 'Error: %s\n', err.message ) );
		}
	}
Sets a keybinding.

@private
@param {string} action - action name
@param {Array<Object>} [keys] - list of keys
@returns {void}