Skip to content

Commit

Permalink
tec: Improve the look of CLI usage command
Browse files Browse the repository at this point in the history
  • Loading branch information
marienfressinaud committed Apr 20, 2021
1 parent 32837b1 commit f2078d8
Showing 1 changed file with 39 additions and 32 deletions.
71 changes: 39 additions & 32 deletions src/cli/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,45 @@ class System
{
public function usage()
{
$usage = 'Usage: php ./cli --request REQUEST [-pKEY=VALUE]...' . "\n\n";
$usage .= 'REQUEST can be one of the following:' . "\n";
$usage .= ' / Show this help' . "\n";
$usage .= ' /database/status Return the status of the DB connection' . "\n";
$usage .= ' /feeds List the feeds' . "\n";
$usage .= ' /feeds/add Add a feed' . "\n";
$usage .= ' -purl=URL where URL is the link to the feed' . "\n";
$usage .= ' /feeds/sync Synchronize a feed' . "\n";
$usage .= ' -pid=ID where ID is the id of the feed' . "\n";
$usage .= ' [-pnocache=BOOL] Indicates if the cache should be ignored (default is false)' . "\n";
$usage .= ' /jobs List the jobs' . "\n";
$usage .= ' /jobs/clear Delete all the jobs' . "\n";
$usage .= ' /jobs/run Execute one waiting job' . "\n";
$usage .= ' /jobs/watch Wait and execute jobs' . "\n";
$usage .= ' /links/refresh Refresh the oldest links (only illustration images)' . "\n";
$usage .= ' [-pnumber=NUMBER] where NUMBER is the number of links to refresh (default is 10)' . "\n";
$usage .= ' /system/rollback Reverse the last migration' . "\n";
$usage .= ' [-psteps=NUMBER] where NUMBER is the number of rollbacks to apply (default is 1)' . "\n";
$usage .= ' /system/secret Generate a secure key to be used as APP_SECRET_KEY' . "\n";
$usage .= ' /system/setup Initialize or update the system' . "\n";
$usage .= ' /topics List the topics' . "\n";
$usage .= ' /topics/create Create a topic' . "\n";
$usage .= ' -plabel=TEXT where TEXT is a 21-chars max string' . "\n";
$usage .= ' /topics/delete Delete a topic' . "\n";
$usage .= ' -pid=ID where ID is the id of the topic to delete' . "\n";
$usage .= ' /users List all the users' . "\n";
$usage .= ' /users/clean Clean not validated users created NUMBER months ago' . "\n";
$usage .= ' [-psince=NUMBER] where NUMBER is the number of months, greater than 0 (default is 1)' . "\n";
$usage .= ' /users/create Create a user' . "\n";
$usage .= ' -pemail=EMAIL' . "\n";
$usage .= ' -ppassword=PASSWORD' . "\n";
$usage .= ' -pusername=USERNAME where USERNAME is a 50-chars max string';
$usage = "Usage: php ./cli --request REQUEST [-pKEY=VALUE]...\n\n";
$usage .= "REQUEST can be one of the following:\n";
$usage .= " / Show this help\n";
$usage .= "\n";
$usage .= " /database/status Return the status of the DB connection\n";
$usage .= "\n";
$usage .= " /feeds List the feeds\n";
$usage .= " /feeds/add Add a feed\n";
$usage .= " -purl=URL where URL is the link to the feed\n";
$usage .= " /feeds/sync Synchronize a feed\n";
$usage .= " -pid=ID where ID is the id of the feed\n";
$usage .= " [-pnocache=BOOL] Indicates if the cache should be ignored (default is false)\n";
$usage .= "\n";
$usage .= " /jobs List the jobs\n";
$usage .= " /jobs/clear Delete all the jobs\n";
$usage .= " /jobs/run Execute one waiting job\n";
$usage .= " /jobs/watch Wait and execute jobs\n";
$usage .= "\n";
$usage .= " /links/refresh Refresh the oldest links (only illustration images)\n";
$usage .= " [-pnumber=NUMBER] where NUMBER is the number of links to refresh (default is 10)\n";
$usage .= "\n";
$usage .= " /system/rollback Reverse the last migration\n";
$usage .= " [-psteps=NUMBER] where NUMBER is the number of rollbacks to apply (default is 1)\n";
$usage .= " /system/secret Generate a secure key to be used as APP_SECRET_KEY\n";
$usage .= " /system/setup Initialize or update the system\n";
$usage .= "\n";
$usage .= " /topics List the topics\n";
$usage .= " /topics/create Create a topic\n";
$usage .= " -plabel=TEXT where TEXT is a 21-chars max string\n";
$usage .= " /topics/delete Delete a topic\n";
$usage .= " -pid=ID where ID is the id of the topic to delete\n";
$usage .= "\n";
$usage .= " /users List all the users\n";
$usage .= " /users/clean Clean not validated users created NUMBER months ago\n";
$usage .= " [-psince=NUMBER] where NUMBER is the number of months, greater than 0 (default is 1)\n";
$usage .= " /users/create Create a user\n";
$usage .= " -pemail=EMAIL\n";
$usage .= " -ppassword=PASSWORD\n";
$usage .= " -pusername=USERNAME where USERNAME is a 50-chars max string";

return Response::text(200, $usage);
}
Expand Down

0 comments on commit f2078d8

Please sign in to comment.