Skip to content

Commit

Permalink
chore: update some git command options
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Apr 20, 2022
1 parent cefeef0 commit b3c7318
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/Console/Controller/Gitx/GitLabController.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public function configCommand(FlagsParser $fs, Output $output): void
}

/**
* checkout an new branch for development
* checkout an new branch for development. alias for `br new`
*
* @options
* --nm, --not-main bool;Dont push new branch to the main remote
Expand All @@ -404,8 +404,8 @@ public function newBranchCommand(FlagsParser $fs, Output $output): void
* delete branches from local, origin, main remote
*
* @options
* -f, --force bool;Force execute delete command, ignore error
* --not-main bool;Dont delete branch on the main remote
* -f, --force bool;Force execute delete command, ignore error
* --nm, --not-main bool;Dont delete branch on the main remote
*
* @arguments
* branches... array;The want deleted branch name(s). eg: fea_6_12;required
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Controller/JavaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function json2classCommand(Output $output): void
*/
public function sql2classCommand(FlagsParser $fs, Output $output): void
{
$output->success('Complete');
$output->success('TODO');
}

/**
Expand Down
50 changes: 50 additions & 0 deletions app/Console/SubCmd/Gitflow/BranchDeleteCmd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php declare(strict_types=1);

namespace Inhere\Kite\Console\SubCmd\Gitflow;

use Inhere\Console\Command;
use Inhere\Console\IO\Input;
use Inhere\Console\IO\Output;
use Toolkit\PFlag\FlagsParser;

/**
* Class BranchDeleteCmd
*
* @package Inhere\Kite\Console\Controller\Gitlab
*/
class BranchDeleteCmd extends Command
{
protected static string $name = 'delete';
protected static string $desc = 'delete git branches from local, origin, main remote';

public static function aliases(): array
{
return ['del', 'rem', 'rm'];
}

protected function configFlags(FlagsParser $fs): void
{
// $this->flags->addOptByRule($name, $rule);
}

/**
* delete branches from local, origin, main remote
*
* @options
* -f, --force bool;Force execute delete command, ignore error
* --nm, --not-main bool;Dont delete branch on the main remote
*
* @arguments
* branches... array;The want deleted branch name(s). eg: fea_6_12;required
*
* @param Input $input
* @param Output $output
*
* @return mixed
*/
protected function execute(Input $input, Output $output): mixed
{
$output->println(__METHOD__);
return 0;
}
}

0 comments on commit b3c7318

Please sign in to comment.