1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Swaggest\JsonCli; |
4
|
|
|
|
5
|
|
|
use Yaoi\Command; |
6
|
|
|
use Yaoi\Command\Definition; |
7
|
|
|
|
8
|
|
|
class App extends Command\Application |
9
|
|
|
{ |
10
|
|
|
public static $ver = 'v1.11.2'; |
11
|
|
|
|
12
|
|
|
public $diff; |
13
|
|
|
public $apply; |
14
|
|
|
public $rearrange; |
15
|
|
|
public $diffInfo; |
16
|
|
|
public $prettyPrint; |
17
|
|
|
public $minify; |
18
|
|
|
public $replace; |
19
|
|
|
public $resolve; |
20
|
|
|
public $resolvePos; |
21
|
|
|
public $validateSchema; |
22
|
|
|
public $genGo; |
23
|
|
|
public $genPhp; |
24
|
|
|
public $genJSDoc; |
25
|
1 |
|
public $genJson; |
26
|
|
|
public $genMarkdown; |
27
|
1 |
|
public $buildSchema; |
28
|
1 |
|
|
29
|
1 |
|
/** |
30
|
|
|
* @param Definition $definition |
31
|
1 |
|
* @param \stdClass|static $commandDefinitions |
32
|
1 |
|
*/ |
33
|
1 |
|
static function setUpCommands(Definition $definition, $commandDefinitions) |
34
|
1 |
|
{ |
35
|
1 |
|
$definition->name = 'json-cli'; |
36
|
1 |
|
$definition->version = self::$ver; |
37
|
1 |
|
$definition->description = 'JSON CLI tool, https://github.com/swaggest/json-cli'; |
38
|
1 |
|
|
39
|
1 |
|
$commandDefinitions->diff = Diff::definition(); |
40
|
1 |
|
$commandDefinitions->apply = Apply::definition(); |
41
|
1 |
|
$commandDefinitions->rearrange = Rearrange::definition(); |
42
|
|
|
$commandDefinitions->diffInfo = DiffInfo::definition(); |
43
|
|
|
$commandDefinitions->prettyPrint = PrettyPrint::definition(); |
44
|
|
|
$commandDefinitions->minify = Minify::definition(); |
45
|
|
|
$commandDefinitions->replace = Replace::definition(); |
46
|
|
|
$commandDefinitions->resolve = Resolve::definition(); |
47
|
|
|
$commandDefinitions->resolvePos = ResolvePos::definition(); |
48
|
|
|
$commandDefinitions->validateSchema = ValidateSchema::definition(); |
49
|
|
|
$commandDefinitions->genGo = GenGo::definition(); |
50
|
|
|
$commandDefinitions->genPhp = GenPhp::definition(); |
51
|
|
|
$commandDefinitions->genJSDoc = GenJSDoc::definition(); |
52
|
|
|
$commandDefinitions->genJson = GenJson::definition(); |
53
|
|
|
$commandDefinitions->genMarkdown = GenMarkdown::definition(); |
54
|
|
|
$commandDefinitions->buildSchema = BuildSchema::definition(); |
55
|
|
|
} |
56
|
|
|
} |