<commit_before><?php

// Add the command to the wp-cli
WP_CLI::addCommand('home', 'HomeCommand');

/**
 * Implement home command
 *
 * @package wp-cli
 * @subpackage commands/internals
 * @author <NAME>
 */
class HomeCommand extends WP_CLI_Command {
	/**
	 * Overwrite the construct to have a command without subcommand
	 *
	 * @param string $args 
	 * @author <NAME>
	 */
	function __construct($args) {
		if(empty($args)) {
			// Open the wp-cli page in the browser
			exec('open https://github.com/andreascreten/wp-cli');
			
			WP_CLI::success('The wp-cli homepage should be opening in your browser.');
		}
		else {
			// Call the parent constructor
			parent::__construct($args);
		}
	}
	
	/**
	 * Help function for this command
	 *
	 * @param string $args 
	 * @return void
	 * @author <NAME>
	 */
	public function help($args = array()) {
		WP_CLI::line('This command has no arguments, when called it will open the wp-cli homepage in your browser.');
		WP_CLI::line();<commit_msg>Fix for home command on linux (fixes #1)<commit_after><?php

// Add the command to the wp-cli
WP_CLI::addCommand('home', 'HomeCommand');

/**
 * Implement home command
 *
 * @package wp-cli
 * @subpackage commands/internals
 * @author <NAME>
 */
class HomeCommand extends WP_CLI_Command {
	/**
	 * Overwrite the construct to have a command without subcommand
	 *
	 * @param string $args 
	 * @author <NAME>
	 */
	function __construct($args) {
		if(empty($args)) {
			// Check if the x-www-browser command exists
			$result = exec('which x-www-browser');
			
			// Open the wp-cli page in the browser
			if(exec('which x-www-browser')) {
				system('x-www-browser http://github.comandreascreten/wp-cli');
			}
			elseif(exec('which open')) {
				system('open https://github.com/andreascreten/wp-cli');
			}
			else {
				WP_CLI::error('No command found to open the homepage in the browser. Please open it manually: https://github.com/andreascreten/wp-cli');
				return;
			}
			
			WP_CLI::success('The wp-cli homepage should be opening in your browser.');
		}
		else {
			// Call the parent constructor
			parent::__construct($args);
		}
	}
	
	/**
	 * Help function for this command
	 *
	 * @param string $args 
	 * @return void
	 * @author <NAME>
	 */
	public function help($args = array()) {
		WP_CLI::line('This command has no arguments, when called it will open the wp-cli homepage in your browser.');
		WP_CLI::line();
{'fraction_non_alphanumeric': 0.13870431893687707, 'fraction_numerical': 0.0004152823920265781, 'mean_word_length': 3.324955116696589, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 3, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5419761', 'n_tokens_mistral': 849, 'n_tokens_neox': 753, 'n_words': 230}