Completed
Push — master ( 83dd26...e508a1 )
by Nazar
04:18
created

Controller::__help()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 22
rs 9.2
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
/**
3
 * @package    CleverStyle CMS
4
 * @subpackage System module
5
 * @category   modules
6
 * @author     Nazar Mokrynskyi <[email protected]>
7
 * @copyright  Copyright (c) 2016, Nazar Mokrynskyi
8
 * @license    MIT License, see license.txt
9
 */
10
namespace cs\modules\System\cli;
11
use
12
	cs\modules\System\cli\Controller\optimization;
13
use function
14
	cli\line;
15
16
class Controller {
17
	use
18
		optimization;
19
	static function __help () {
20
		$version = file_get_json(__DIR__.'/../meta.json')['version'];
21
		$help    = <<<HELP
22
%gCleverStyle CMS%n version %y$version%n, CLI interface%n
23
24
%yUsage:%n
25
  [method:]path [arguments]
26
27
%yUniversal methods:%n
28
  %gcli%n  Prints all cli paths and methods available for specified path
29
  %ghelp%n Displays help for module or path (should be provided by developer, otherwise will fallback to %gcli%n)
30
31
%yExamples%n
32
  Print all paths and methods available in the whole system:
33
    %g./cli cli:%n
34
  Print all paths and method available in System module:
35
    %g./cli cli:System%n
36
  Print all paths and method available in System module, admin sub-path:
37
    %g./cli cli:System/admin%n
38
HELP;
39
		line($help);
40
	}
41
}
42