Skip to content

Commit

Permalink
up: register some commands to gen and http group
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jun 7, 2022
1 parent 64fb163 commit 1e99dd2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 9 additions & 2 deletions app/Console/Controller/GenerateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Inhere\Console\Controller;
use Inhere\Console\Exception\PromptException;
use Inhere\Console\IO\Output;
use Inhere\Kite\Console\SubCmd\ToolCmd\HashCommand;
use Inhere\Kite\Helper\AppHelper;
use Inhere\Kite\Kite;
use PhpPkg\EasyTpl\TextTemplate;
Expand Down Expand Up @@ -46,6 +47,12 @@ protected static function commandAliases(): array
];
}

protected function subCommands(): array
{
return [
HashCommand::class,
];
}
/**
* @param Output $output
*/
Expand Down Expand Up @@ -179,8 +186,8 @@ public function idCommand(FlagsParser $fs, Output $output): void
* generate an random string.
*
* @options
* -l, --length The string length. default: 12
* -n, --number The number of generated strings. default: 1
* -l, --length int;The string length. default: 12
* -n, --number int;The number of generated strings. default: 1
* -t, --template The sample template name. allow: alpha, alpha_num, alpha_num_c
*
* @param FlagsParser $fs
Expand Down
7 changes: 5 additions & 2 deletions app/Console/Controller/HttpController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Inhere\Console\Controller;
use Inhere\Console\IO\Output;
use Inhere\Kite\Console\Component\ContentsAutoReader;
use Inhere\Kite\Console\SubCmd\OpenUrlCmd;
use Inhere\Kite\Console\SubCmd\ParseUrlQueryCmd;
use Toolkit\PFlag\FlagsParser;
use Toolkit\Stdlib\Str\UrlHelper;
Expand All @@ -31,15 +32,17 @@ class HttpController extends Controller
protected static function commandAliases(): array
{
return [
'bulk2query' => ['2query', 'to-query'],
'dequery' => ParseUrlQueryCmd::aliases(),
'bulk2query' => ['2query', 'to-query'],
'dequery' => ParseUrlQueryCmd::aliases(),
OpenUrlCmd::getName() => ['open', 'open-url'],
];
}

protected function subCommands(): array
{
return [
ParseUrlQueryCmd::class,
OpenUrlCmd::class,
];
}

Expand Down

0 comments on commit 1e99dd2

Please sign in to comment.