{"action":"created","comment":{"url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/comments/49222172","id":49222172,"diff_hunk":"@@ -81,3 +81,11 @@\n \n // Cron\n require_once( WPSC_FILE_PATH . '/wpsc-includes/cron.php' );\n+\n+// WP-CLI support\n+if ( defined( 'WP_CLI' ) && WP_CLI && version_compare( phpversion(), '5.3', '>=' ) ) {\n+\trequire_once( WPSC_FILE_PATH . '/wpsc-includes/wpsc-wp-cli-category.php');\n+\tWP_CLI::add_command( 'wpsc-category', 'WPSC_WP_CLI_Category_Command' );\n+\trequire_once( WPSC_FILE_PATH . '/wpsc-includes/wpsc-wp-cli-product-tag.php');\n+\tWP_CLI::add_command( 'wpsc-product-tag', 'WPSC_WP_CLI_Product_Tag_Command' );\n+}","path":"wpsc-core/wpsc-includes.php","position":11,"original_position":11,"commit_id":"d049f4733941c9aa900eb1382ba4450deb565bf8","original_commit_id":"d049f4733941c9aa900eb1382ba4450deb565bf8","user":{"login":"JustinSainton","id":1168754,"avatar_url":"https://avatars.githubusercontent.com/u/1168754?v=3","gravatar_id":"","url":"https://api.github.com/users/JustinSainton","html_url":"https://github.com/JustinSainton","followers_url":"https://api.github.com/users/JustinSainton/followers","following_url":"https://api.github.com/users/JustinSainton/following{/other_user}","gists_url":"https://api.github.com/users/JustinSainton/gists{/gist_id}","starred_url":"https://api.github.com/users/JustinSainton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JustinSainton/subscriptions","organizations_url":"https://api.github.com/users/JustinSainton/orgs","repos_url":"https://api.github.com/users/JustinSainton/repos","events_url":"https://api.github.com/users/JustinSainton/events{/privacy}","received_events_url":"https://api.github.com/users/JustinSainton/received_events","type":"User","site_admin":false},"body":"As we iterate, it's probably going to make more sense to just replace this all with a require_once of a `wpsc-wp-cli.php` type of file, which will include all the sub-commands. ","created_at":"2016-01-08T18:46:26Z","updated_at":"2016-01-08T18:46:26Z","html_url":"https://github.com/wp-e-commerce/WP-e-Commerce/pull/1859#discussion_r49222172","pull_request_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/1859","_links":{"self":{"href":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/comments/49222172"},"html":{"href":"https://github.com/wp-e-commerce/WP-e-Commerce/pull/1859#discussion_r49222172"},"pull_request":{"href":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/1859"}}},"pull_request":{"url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/1859","id":34207608,"html_url":"https://github.com/wp-e-commerce/WP-e-Commerce/pull/1859","diff_url":"https://github.com/wp-e-commerce/WP-e-Commerce/pull/1859.diff","patch_url":"https://github.com/wp-e-commerce/WP-e-Commerce/pull/1859.patch","issue_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/issues/1859","number":1859,"state":"closed","locked":false,"title":"WP-CLI support","user":{"login":"leewillis77","id":1097338,"avatar_url":"https://avatars.githubusercontent.com/u/1097338?v=3","gravatar_id":"","url":"https://api.github.com/users/leewillis77","html_url":"https://github.com/leewillis77","followers_url":"https://api.github.com/users/leewillis77/followers","following_url":"https://api.github.com/users/leewillis77/following{/other_user}","gists_url":"https://api.github.com/users/leewillis77/gists{/gist_id}","starred_url":"https://api.github.com/users/leewillis77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leewillis77/subscriptions","organizations_url":"https://api.github.com/users/leewillis77/orgs","repos_url":"https://api.github.com/users/leewillis77/repos","events_url":"https://api.github.com/users/leewillis77/events{/privacy}","received_events_url":"https://api.github.com/users/leewillis77/received_events","type":"User","site_admin":false},"body":"Initial WP-CLI support based on work originally done here: https://github.com/leewillis77/WP-CLI-WPEC-Command. Note @todos in the code, and also the lack of explicit documentation. \r\n\r\nCommands are self documenting, so running:\r\n\r\n```$ wp help```\r\n\r\nWill include the available commands in its output, e.g. \r\n\r\n```\r\nNAME\r\n\r\n  wp\r\n\r\nDESCRIPTION\r\n\r\n  Manage WordPress through the command-line.\r\n\r\nSYNOPSIS\r\n\r\n  wp <command>\r\n\r\nSUBCOMMANDS\r\n\r\n[...]\r\n  wpsc-category         Commands for working with WP e-Commerce product categories.\r\n  wpsc-product-tag      Commands for working with WP e-Commerce product tags.\r\n```\r\n\r\nRunning ```wp help {command}``` will show more detailed usage, e.g. \r\n\r\n```\r\nNAME\r\n\r\n  wp wpsc-category\r\n\r\nDESCRIPTION\r\n\r\n  Commands for working with WP e-Commerce product categories.\r\n\r\nSYNOPSIS\r\n\r\n  wp wpsc-category <command>\r\n\r\nSUBCOMMANDS\r\n\r\n  create        Create a new category.\r\n  delete        Delete one or more product categories.\r\n  generate      Generate product categories.\r\n  get           Get a single category.\r\n  list          Get a list of product categories.\r\n```\r\n\r\nDitto, for sub-commands, e.g. ```wp help wpsc-category create``` outputs:\r\n\r\n```\r\nNAME\r\n\r\n  wp wpsc-category create\r\n\r\nDESCRIPTION\r\n\r\n  Create a new category.\r\n\r\nSYNOPSIS\r\n\r\n  wp wpsc-category create <name> [--description=<description>]\r\n  [--parent=<parent_id>] [--slug=<slug>]\r\n\r\nOPTIONS\r\n\r\n  <name>\r\n    The name of the category.\r\n\r\n  [--description=<description>]\r\n    The description of the category.\r\n\r\n  [--parent=<parent_id>]\r\n    The parent category ID to assign to this category.\r\n\r\n  [--slug=<slug>]\r\n    The slug to assign to this category.\r\n\r\nEXAMPLES\r\n\r\n    wp wpsc-category create \"My category\"\r\n\r\n    wp wpsc-category create \"Sub-category\" --parent=4 --slug=\"sub-cat\" --description=\"More\r\n  specific awesome stuff\"\r\n```\r\n","created_at":"2015-04-27T20:36:56Z","updated_at":"2016-01-08T18:46:26Z","closed_at":"2016-01-08T18:45:32Z","merged_at":"2016-01-08T18:45:32Z","merge_commit_sha":"3b5d04e02647cecb8157cdae8ff60b73c53cb41c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/1859/commits","review_comments_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/1859/comments","review_comment_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/issues/1859/comments","statuses_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/statuses/d049f4733941c9aa900eb1382ba4450deb565bf8","head":{"label":"leewillis77:wp-cli-support","ref":"wp-cli-support","sha":"d049f4733941c9aa900eb1382ba4450deb565bf8","user":{"login":"leewillis77","id":1097338,"avatar_url":"https://avatars.githubusercontent.com/u/1097338?v=3","gravatar_id":"","url":"https://api.github.com/users/leewillis77","html_url":"https://github.com/leewillis77","followers_url":"https://api.github.com/users/leewillis77/followers","following_url":"https://api.github.com/users/leewillis77/following{/other_user}","gists_url":"https://api.github.com/users/leewillis77/gists{/gist_id}","starred_url":"https://api.github.com/users/leewillis77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leewillis77/subscriptions","organizations_url":"https://api.github.com/users/leewillis77/orgs","repos_url":"https://api.github.com/users/leewillis77/repos","events_url":"https://api.github.com/users/leewillis77/events{/privacy}","received_events_url":"https://api.github.com/users/leewillis77/received_events","type":"User","site_admin":false},"repo":{"id":11459388,"name":"WP-e-Commerce","full_name":"leewillis77/WP-e-Commerce","owner":{"login":"leewillis77","id":1097338,"avatar_url":"https://avatars.githubusercontent.com/u/1097338?v=3","gravatar_id":"","url":"https://api.github.com/users/leewillis77","html_url":"https://github.com/leewillis77","followers_url":"https://api.github.com/users/leewillis77/followers","following_url":"https://api.github.com/users/leewillis77/following{/other_user}","gists_url":"https://api.github.com/users/leewillis77/gists{/gist_id}","starred_url":"https://api.github.com/users/leewillis77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leewillis77/subscriptions","organizations_url":"https://api.github.com/users/leewillis77/orgs","repos_url":"https://api.github.com/users/leewillis77/repos","events_url":"https://api.github.com/users/leewillis77/events{/privacy}","received_events_url":"https://api.github.com/users/leewillis77/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leewillis77/WP-e-Commerce","description":"WP e-Commerce Plugin - The most popular and robust e-Commerce solution for WordPress","fork":true,"url":"https://api.github.com/repos/leewillis77/WP-e-Commerce","forks_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/forks","keys_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/teams","hooks_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/hooks","issue_events_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/issues/events{/number}","events_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/events","assignees_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/assignees{/user}","branches_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/branches{/branch}","tags_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/tags","blobs_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/statuses/{sha}","languages_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/languages","stargazers_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/stargazers","contributors_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/contributors","subscribers_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/subscribers","subscription_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/subscription","commits_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/contents/{+path}","compare_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/merges","archive_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/downloads","issues_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/issues{/number}","pulls_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/pulls{/number}","milestones_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/milestones{/number}","notifications_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/labels{/name}","releases_url":"https://api.github.com/repos/leewillis77/WP-e-Commerce/releases{/id}","created_at":"2013-07-16T20:23:59Z","updated_at":"2015-10-02T09:58:32Z","pushed_at":"2016-01-01T20:47:18Z","git_url":"git://github.com/leewillis77/WP-e-Commerce.git","ssh_url":"git@github.com:leewillis77/WP-e-Commerce.git","clone_url":"https://github.com/leewillis77/WP-e-Commerce.git","svn_url":"https://github.com/leewillis77/WP-e-Commerce","homepage":"http://getshopped.org","size":15259,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wp-e-commerce:master","ref":"master","sha":"8f751e88aebd3e2526d2c4b745cf5e0e35fd5f04","user":{"login":"wp-e-commerce","id":2290601,"avatar_url":"https://avatars.githubusercontent.com/u/2290601?v=3","gravatar_id":"","url":"https://api.github.com/users/wp-e-commerce","html_url":"https://github.com/wp-e-commerce","followers_url":"https://api.github.com/users/wp-e-commerce/followers","following_url":"https://api.github.com/users/wp-e-commerce/following{/other_user}","gists_url":"https://api.github.com/users/wp-e-commerce/gists{/gist_id}","starred_url":"https://api.github.com/users/wp-e-commerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wp-e-commerce/subscriptions","organizations_url":"https://api.github.com/users/wp-e-commerce/orgs","repos_url":"https://api.github.com/users/wp-e-commerce/repos","events_url":"https://api.github.com/users/wp-e-commerce/events{/privacy}","received_events_url":"https://api.github.com/users/wp-e-commerce/received_events","type":"Organization","site_admin":false},"repo":{"id":2052629,"name":"WP-e-Commerce","full_name":"wp-e-commerce/WP-e-Commerce","owner":{"login":"wp-e-commerce","id":2290601,"avatar_url":"https://avatars.githubusercontent.com/u/2290601?v=3","gravatar_id":"","url":"https://api.github.com/users/wp-e-commerce","html_url":"https://github.com/wp-e-commerce","followers_url":"https://api.github.com/users/wp-e-commerce/followers","following_url":"https://api.github.com/users/wp-e-commerce/following{/other_user}","gists_url":"https://api.github.com/users/wp-e-commerce/gists{/gist_id}","starred_url":"https://api.github.com/users/wp-e-commerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wp-e-commerce/subscriptions","organizations_url":"https://api.github.com/users/wp-e-commerce/orgs","repos_url":"https://api.github.com/users/wp-e-commerce/repos","events_url":"https://api.github.com/users/wp-e-commerce/events{/privacy}","received_events_url":"https://api.github.com/users/wp-e-commerce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wp-e-commerce/WP-e-Commerce","description":"WP eCommerce - The most popular independent eCommerce platform for WordPress","fork":false,"url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce","forks_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/forks","keys_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/teams","hooks_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/hooks","issue_events_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/issues/events{/number}","events_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/events","assignees_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/assignees{/user}","branches_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/branches{/branch}","tags_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/tags","blobs_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/statuses/{sha}","languages_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/languages","stargazers_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/stargazers","contributors_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/contributors","subscribers_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/subscribers","subscription_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/subscription","commits_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/contents/{+path}","compare_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/merges","archive_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/downloads","issues_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/issues{/number}","pulls_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls{/number}","milestones_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/milestones{/number}","notifications_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/labels{/name}","releases_url":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/releases{/id}","created_at":"2011-07-15T10:54:16Z","updated_at":"2016-01-08T16:45:09Z","pushed_at":"2016-01-08T18:45:34Z","git_url":"git://github.com/wp-e-commerce/WP-e-Commerce.git","ssh_url":"git@github.com:wp-e-commerce/WP-e-Commerce.git","clone_url":"https://github.com/wp-e-commerce/WP-e-Commerce.git","svn_url":"https://github.com/wp-e-commerce/WP-e-Commerce","homepage":"https://wpecommerce.org","size":16957,"stargazers_count":173,"watchers_count":173,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":182,"mirror_url":null,"open_issues_count":391,"forks":182,"open_issues":391,"watchers":173,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/1859"},"html":{"href":"https://github.com/wp-e-commerce/WP-e-Commerce/pull/1859"},"issue":{"href":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/issues/1859"},"comments":{"href":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/issues/1859/comments"},"review_comments":{"href":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/1859/comments"},"review_comment":{"href":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/pulls/1859/commits"},"statuses":{"href":"https://api.github.com/repos/wp-e-commerce/WP-e-Commerce/statuses/d049f4733941c9aa900eb1382ba4450deb565bf8"}}}}