-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
up: update some git,php,json and extra commands
- Loading branch information
Showing
10 changed files
with
111 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Inhere\Kite\Console\SubCmd\GitxCmd; | ||
|
||
use Inhere\Console\Command; | ||
use Inhere\Console\Component\Symbol\GitEmoji; | ||
use Inhere\Console\IO\Input; | ||
use Inhere\Console\IO\Output; | ||
use Inhere\Kite\Common\CmdRunner; | ||
|
||
/** | ||
* class GitTagListCmd | ||
* | ||
* @author inhere | ||
* @date 2022/7/12 | ||
*/ | ||
class GitEmojiCmd extends Command | ||
{ | ||
protected static string $name = 'emoji'; | ||
protected static string $desc = 'git emoji list or search by keywords'; | ||
|
||
public static function aliases(): array | ||
{ | ||
return ['moji', 'emj']; | ||
} | ||
|
||
protected function getArguments(): array | ||
{ | ||
return [ | ||
'keywords' => 'match special emoji by keywords', | ||
]; | ||
} | ||
|
||
protected function execute(Input $input, Output $output) | ||
{ | ||
$fs = $this->flags; | ||
$ge = GitEmoji::new(); | ||
|
||
if ($kw = $fs->getArg('keywords')) { | ||
$matched = $ge->search($kw); | ||
if ($matched) { | ||
$output->table($matched, "matched emojis by '$kw'"); | ||
} else { | ||
$output->info('not found matched emojis'); | ||
} | ||
return; | ||
} | ||
|
||
$output->table($ge->getEmojis()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters