Skip to content

Commit

Permalink
improve help add highlight and add logger help
Browse files Browse the repository at this point in the history
  • Loading branch information
zamronypj committed Jun 22, 2021
1 parent ead9ffe commit 1ddf9be
Show file tree
Hide file tree
Showing 30 changed files with 44 additions and 28 deletions.
9 changes: 9 additions & 0 deletions src/Libs/Includes/units.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(*!------------------------------------------------------------
* Fano CLI Application (https://fanoframework.github.io)
*
* @link https://github.com/fanoframework/fano-cli
* @copyright Copyright (c) 2018 - 2020 Zamrony P. Juhara
* @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT)
*------------------------------------------------------------- *)

strformats,
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Controller/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TCreateControllerTaskFactory.create();
try
appInst.registerTask(
'controller',
'--controller=[controller-name] Create new controller' + LineEnding +
formatColor('--controller', TXT_GREEN) + '=[controller-name] Create new controller' + LineEnding +
' --route=[route pattern] if omitted, controller name is assumed.' + LineEnding +
' --method=[request method] if omitted, HTTP GET is assumed.',
taskFactory.build()
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Daemon/SystemD/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TSystemDDaemonTaskFactory.create();
try
appInst.registerTask(
'daemon-sysd',
'--daemon-sysd=[service name] Register daemon as service in SystemD.' + LineEnding +
formatColor('--daemon-sysd', TXT_GREEN) + '=[service name] Register daemon as service in SystemD.' + LineEnding +
' --user=[username] User whose service will be run as. If not set, current non-root user is used.' + LineEnding +
' --bin=[application binary] Path of executable binary. If not set then, default bin/app.cgi is used.',
taskFactory.build()
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Deploy/Cgi/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TXDeployCgiTaskFactory.create();
try
appInst.registerTask(
'deploy-cgi',
'--deploy-cgi=[server name] Deploy as CGI web application.' + LineEnding +
formatColor('--deploy-cgi', TXT_GREEN) + '=[server name] Deploy as CGI web application.' + LineEnding +
' --web-server=[web server] if omitted, apache is assumed.' + LineEnding +
' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding +
' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.',
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Deploy/Fcgi/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TXDeployFcgiTaskFactory.create();
try
appInst.registerTask(
'deploy-fcgi',
'--deploy-fcgi=[server name] Deploy as FastCGI web application with mod_proxy_fcgi.' + LineEnding +
formatColor('--deploy-fcgi', TXT_GREEN) + '=[server name] Deploy as FastCGI web application with mod_proxy_fcgi.' + LineEnding +
' --web-server=[web server] if omitted, apache is assumed.' + LineEnding +
' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding +
' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TXDeployFcgiBalancerTaskFactory.create();
try
appInst.registerTask(
'deploy-lb-fcgi',
'--deploy-lb-fcgi=[server name] Deploy as FastCGI web application with mod_proxy_balancer.' + LineEnding +
formatColor('--deploy-lb-fcgi', TXT_GREEN) + '=[server name] Deploy as FastCGI web application with mod_proxy_balancer.' + LineEnding +
' --members=[host1:port1,host2:port2,...], if omitted, 2 default members is assumed.' + LineEnding +
' --lbmethod=[load balancing scheduler algorithm] if omitted, byrequests is assumed.' + LineEnding +
' --web-server=[web server] if omitted, apache is assumed.' + LineEnding +
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Deploy/Fcgid/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TXDeployFCgidTaskFactory.create();
try
appInst.registerTask(
'deploy-fcgid',
'--deploy-fcgid=[server name] Deploy as FastCGI web application with mod_fcgid.' + LineEnding +
formatColor('--deploy-fcgid', TXT_GREEN) + '=[server name] Deploy as FastCGI web application with mod_fcgid.' + LineEnding +
' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding +
' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.',
taskFactory.build()
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Deploy/Http/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TXDeployHttpTaskFactory.create();
try
appInst.registerTask(
'deploy-http',
'--deploy-http=[server name] Deploy as http web application over http reverse proxy server.' + LineEnding +
formatColor('--deploy-http', TXT_GREEN) + '=[server name] Deploy as http web application over http reverse proxy server.' + LineEnding +
' --web-server=[web server] if omitted, apache is assumed.' + LineEnding +
' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding +
' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TXDeployHttpBalancerTaskFactory.create();
try
appInst.registerTask(
'deploy-lb-http',
'--deploy-lb-http=[server name] Deploy as http web application with mod_proxy_balancer.' + LineEnding +
formatColor('--deploy-lb-http', TXT_GREEN) + '=[server name] Deploy as http web application with mod_proxy_balancer.' + LineEnding +
' --members=[host1:port1,host2:port2,...], if omitted, 2 default members is assumed.' + LineEnding +
' --lbmethod=[load balancing scheduler algorithm] if omitted, byrequests is assumed.' + LineEnding +
' --web-server=[web server] if omitted, apache is assumed.' + LineEnding +
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Deploy/Scgi/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TXDeployScgiTaskFactory.create();
try
appInst.registerTask(
'deploy-scgi',
'--deploy-scgi=[server name] Deploy as SCGI web application.' + LineEnding +
formatColor('--deploy-scgi', TXT_GREEN) + '=[server name] Deploy as SCGI web application.' + LineEnding +
' --web-server=[web server] if omitted, apache is assumed.' + LineEnding +
' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding +
' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TXDeployScgiBalancerTaskFactory.create();
try
appInst.registerTask(
'deploy-lb-scgi',
'--deploy-lb-scgi=[server name] Deploy as SCGI web application with mod_proxy_balancer.' + LineEnding +
formatColor('--deploy-lb-scgi', TXT_GREEN) + '=[server name] Deploy as SCGI web application with mod_proxy_balancer.' + LineEnding +
' --members=[host1:port1,host2:port2,...], if omitted, 2 default members is assumed.' + LineEnding +
' --lbmethod=[load balancing scheduler algorithm] if omitted, byrequests is assumed.' + LineEnding +
' --web-server=[web server] if omitted, apache is assumed.' + LineEnding +
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Deploy/Uwsgi/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TXDeployUwsgiTaskFactory.create();
try
appInst.registerTask(
'deploy-uwsgi',
'--deploy-uwsgi=[server name] Deploy as uwsgi web application.' + LineEnding +
formatColor('--deploy-uwsgi', TXT_GREEN) + '=[server name] Deploy as uwsgi web application.' + LineEnding +
' --web-server=[web server] if omitted, apache is assumed.' + LineEnding +
' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding +
' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TXDeployUwsgiBalancerTaskFactory.create();
try
appInst.registerTask(
'deploy-lb-uwsgi',
'--deploy-lb-uwsgi=[server name] Deploy as uwsgi web application with mod_proxy_balancer.' + LineEnding +
formatColor('--deploy-lb-uwsgi', TXT_GREEN) + '=[server name] Deploy as uwsgi web application with mod_proxy_balancer.' + LineEnding +
' --members=[host1:port1,host2:port2,...], if omitted, 2 default members is assumed.' + LineEnding +
' --lbmethod=[load balancing scheduler algorithm] if omitted, byrequests is assumed.' + LineEnding +
' --web-server=[web server] if omitted, apache is assumed.' + LineEnding +
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/GuidGen/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

appInst.registerTask(
'guid',
'--guid Generate GUID.',
formatColor('--guid', TXT_GREEN) + ' Generate GUID.',
TGuidGenTask.create()
);
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Info/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

appInst.registerTask(
'help',
'--help Display help information',
formatColor('--help', TXT_GREEN) + ' Display help information',
TWithSingleInfoTask.create(
TSingleInfoTask.create(appInst.getTaskList()),
TInfoTask.create(appInst.getTaskList())
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/KeyGen/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TKeyGenTaskFactory.create();
try
appInst.registerTask(
'key',
'--key=[length] Generate random key.',
formatColor('--key', TXT_GREEN) + '=[length] Generate random key.',
taskFactory.build()
);
finally
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Middleware/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TCreateMiddlewareTaskFactory.create();
try
appInst.registerTask(
'middleware',
'--middleware=[controller-name] Create new middleware',
formatColor('--middleware', TXT_GREEN) + '=[middleware-name] Create new middleware',
taskFactory.build()
);
finally
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Minifier/Css/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TCssMinifierTaskFactory.create();
try
appInst.registerTask(
'cssmin',
'--cssmin=[path] Minify CSS file. Path can be file path or directory.' + LineEnding +
formatColor('--cssmin', TXT_GREEN) + '=[path] Minify CSS file. Path can be file path or directory.' + LineEnding +
' --output=[output path] target output path' + LineEnding +
' if omitted, it is assumed [path].min.css' + LineEnding +
' if output-path = stdout, minified version is output to STDOUT',
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Minifier/Js/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TJsMinifierTaskFactory.create();
try
appInst.registerTask(
'jsmin',
'--jsmin=[path] Minify JavaScript file. Path can be file path or directory.' + LineEnding +
formatColor('--jsmin', TXT_GREEN) + '=[path] Minify JavaScript file. Path can be file path or directory.' + LineEnding +
' --output=[output path] target output path' + LineEnding +
' if omitted, it is assumed [path].min.js' + LineEnding +
' if output-path = stdout, minified version is output to STDOUT',
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Model/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TCreateModelTaskFactory.create();
try
appInst.registerTask(
'model',
'--model=[model-name] Create new model',
formatColor('--model', TXT_GREEN) + '=[model-name] Create new model',
taskFactory.build()
);
finally
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Mvc/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TCreateMvcTaskFactory.create();
try
appInst.registerTask(
'mvc',
'--mvc=[name] Create new controller, model and view',
formatColor('--mvc', TXT_GREEN) + '=[name] Create new controller, model and view',
taskFactory.build()
);
finally
Expand Down
3 changes: 2 additions & 1 deletion src/Tasks/Includes/Project/Cgi/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ taskFactory := TCreateProjectTaskFactory.create(
try
appInst.registerTask(
'project-cgi',
'--project-cgi=[project-name] Create new CGI project.' + LineEnding +
formatColor('--project-cgi', TXT_GREEN) + '=[project-name] Create new CGI project.' + LineEnding +
' --config=[json, ini] Type of generated application config. If omitted, json is assumed.' + LineEnding +
' --with-session=[file, cookie, db] Add session support' + LineEnding +
' --with-middleware Add middleware support' + LineEnding +
' --with-csrf Add CSRF support' + LineEnding +
' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding +
' --no-git if omitted, git repository is created.' + LineEnding +
' --no-initial-commit if omitted, git repository is created with initial commit.',
taskFactory.build()
Expand Down
3 changes: 2 additions & 1 deletion src/Tasks/Includes/Project/FastCgi/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ taskFactory := TCreateDaemonProjectTaskFactory.create(
try
appInst.registerTask(
'project-fcgi',
'--project-fcgi=[project-name] Create new FastCGI project.' + LineEnding +
formatColor('--project-fcgi', TXT_GREEN) + '=[project-name] Create new FastCGI project.' + LineEnding +
' --config=[ini, json] if omitted, config is not setup.' + LineEnding +
' --host=[host where FastCGI app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding +
' --port=[port where FastCGI app listen] if omitted, 20477 is assumed.' + LineEnding +
' --with-session=[file, cookie, db] Add session support' + LineEnding +
' --with-middleware Add middleware support' + LineEnding +
' --with-csrf Add CSRF support' + LineEnding +
' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding +
' --no-git if omitted, git repository is created.' + LineEnding +
' --no-initial-commit if omitted, git repository is created with initial commit.',
taskFactory.build()
Expand Down
3 changes: 2 additions & 1 deletion src/Tasks/Includes/Project/Fcgid/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ taskFactory := TCreateDaemonProjectTaskFactory.create(
try
appInst.registerTask(
'project-fcgid',
'--project-fcgid=[project-name] Create new FastCGI project with Apache and mod_fcgid.' + LineEnding +
formatColor('--project-fcgid', TXT_GREEN) + '=[project-name] Create new FastCGI project with Apache and mod_fcgid.' + LineEnding +
' --config=[ini, json] if omitted, config is not setup.' + LineEnding +
' --with-session=[file, cookie, db] Add session support' + LineEnding +
' --with-middleware Add middleware support' + LineEnding +
' --with-csrf Add CSRF support' + LineEnding +
' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding +
' --no-git if omitted, git repository is created.' + LineEnding +
' --no-initial-commit if omitted, git repository is created with initial commit.',
taskFactory.build()
Expand Down
3 changes: 2 additions & 1 deletion src/Tasks/Includes/Project/Mhd/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ taskFactory := TCreateDaemonProjectTaskFactory.create(
try
appInst.registerTask(
'project-mhd',
'--project-mhd=[project-name] Create new libmicrohttpd project' + LineEnding +
formatColor('--project-mhd', TXT_GREEN) + '=[project-name] Create new libmicrohttpd project' + LineEnding +
' --config=[ini, json] if omitted, config is not setup.' + LineEnding +
' --host=[host where http app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding +
' --port=[port where http app listen] if omitted, 20477 is assumed.' + LineEnding +
' --with-session=[file, cookie, db] Add session support' + LineEnding +
' --with-middleware Add middleware support' + LineEnding +
' --with-csrf Add CSRF support' + LineEnding +
' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding +
' --no-git if omitted, git repository is created.' + LineEnding +
' --no-initial-commit if omitted, git repository is created with initial commit.',
taskFactory.build()
Expand Down
3 changes: 2 additions & 1 deletion src/Tasks/Includes/Project/Scgi/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ taskFactory := TCreateDaemonProjectTaskFactory.create(
try
appInst.registerTask(
'project-scgi',
'--project-scgi=[project-name] Create new SCGI project' + LineEnding +
formatColor('--project-scgi', TXT_GREEN) + '=[project-name] Create new SCGI project' + LineEnding +
' --config=[ini, json] if omitted, config is not setup.' + LineEnding +
' --host=[host where SCGI app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding +
' --port=[port where SCGI app listen] if omitted, 20477 is assumed.' + LineEnding +
' --with-session=[file, cookie, db] Add session support' + LineEnding +
' --with-middleware Add middleware support' + LineEnding +
' --with-csrf Add CSRF support' + LineEnding +
' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding +
' --no-git if omitted, git repository is created.' + LineEnding +
' --no-initial-commit if omitted, git repository is created with initial commit.',
taskFactory.build()
Expand Down
3 changes: 2 additions & 1 deletion src/Tasks/Includes/Project/Uwsgi/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ taskFactory := TCreateDaemonProjectTaskFactory.create(
try
appInst.registerTask(
'project-uwsgi',
'--project-uwsgi=[project-name] Create new uwsgi project' + LineEnding +
formatColor('--project-uwsgi', TXT_GREEN) + '=[project-name] Create new uwsgi project' + LineEnding +
' --config=[ini, json] if omitted, config is not setup.' + LineEnding +
' --host=[host where uwsgi app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding +
' --port=[port where uwsgi app listen] if omitted, 20477 is assumed.' + LineEnding +
' --with-session=[file, cookie, db] Add session support' + LineEnding +
' --with-middleware Add middleware support' + LineEnding +
' --with-csrf Add CSRF support' + LineEnding +
' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding +
' --no-git if omitted, git repository is created.' + LineEnding +
' --no-initial-commit if omitted, git repository is created with initial commit.',
taskFactory.build()
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/Text2Inc/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

appInst.registerTask(
'txt2inc',
'--txt2inc Generate Pascal string variable declaration from file string.' + LineEnding +
formatColor('--txt2inc', TXT_GREEN) + ' Generate Pascal string variable declaration from file string.' + LineEnding +
' --src=[source file path] if omitted, STDIN is used.' + LineEnding +
' --dst=[destination file path]' + LineEnding +
' if omitted and --src is set, use --src file path concatenated with inc extension' + LineEnding +
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Includes/View/task.registrations.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ taskFactory := TCreateViewTaskFactory.create();
try
appInst.registerTask(
'view',
'--view=[view-name] Create new view',
formatColor('--view', TXT_GREEN) + '=[view-name] Create new view',
taskFactory.build()
);
finally
Expand Down
1 change: 1 addition & 0 deletions src/main.units.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
*------------------------------------------------------------- *)

{$INCLUDE Apps/Includes/units.inc}
{$INCLUDE Libs/Includes/units.inc}
{$INCLUDE Tasks/Includes/contracts.inc}
{$INCLUDE Tasks/Includes/units.inc}

0 comments on commit 1ddf9be

Please sign in to comment.