-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
some update. begin add generate auto-complete script
- Loading branch information
Showing
15 changed files
with
383 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# +------------------------------------------------------------------------+ | ||
# | Phalcon Developer Tools | | ||
# +------------------------------------------------------------------------+ | ||
# | Copyright (c) 2011-2016 Phalcon Team (https://www.phalconphp.com) | | ||
# +------------------------------------------------------------------------+ | ||
# | This source file is subject to the New BSD License that is bundled | | ||
# | with this package in the file LICENSE.txt. | | ||
# | | | ||
# | If you did not receive a copy of the license and are unable to | | ||
# | obtain it through the world-wide-web, please send an email | | ||
# | to license@phalconphp.com so we can send you a copy immediately. | | ||
# +------------------------------------------------------------------------+ | ||
# | Authors: Andres Gutierrez <andres@phalconphp.com> | | ||
# | Eduar Carvajal <eduar@phalconphp.com> | | ||
# | Jakob <@jamurko> | | ||
# +------------------------------------------------------------------------+ | ||
# | ||
|
||
_phalcon() | ||
{ | ||
local cur prev | ||
_get_comp_words_by_ref -n = cur prev | ||
|
||
commands="commands list enumerate controller create-controller model \ | ||
create-model all-models create-all-models project create-project scaffold \ | ||
create-scaffold migration create-migration webtools create-webtools" | ||
|
||
case "$prev" in | ||
project|create-project) | ||
COMPREPLY=($(compgen -W "--name --webtools --directory --type --template-path --use-config-ini --trace --help --namespace" -- "$cur")) | ||
return 0 | ||
;; | ||
esac | ||
|
||
COMPREPLY=($(compgen -W "$commands" -- "$cur")) | ||
|
||
} && | ||
complete -F _phalcon phalcon |
Empty file.
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,83 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Inhere | ||
* Date: 2017/12/22 0022 | ||
* Time: 23:13 | ||
*/ | ||
|
||
namespace Inhere\Console\Components\AutoComplete; | ||
|
||
/** | ||
* Class ScriptGenerator | ||
* - generate bash/zsh auto complete script for current console application. | ||
* @package Inhere\Console\Components\AutoComplete | ||
* @link http://www.linuxidc.com/Linux/2016-10/136201.htm | ||
*/ | ||
class ScriptGenerator | ||
{ | ||
const TYPE_BASH = 1; | ||
const TYPE_ZSH = 1; | ||
|
||
// simple: only commands. full: contains command description. | ||
const MODE_SIMPLE = 1; | ||
const MODE_FULL = 2; | ||
|
||
/** @var int The type */ | ||
private $type = 1; | ||
|
||
/** @var int The mode */ | ||
private $mode = 1; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public static function typeList() | ||
{ | ||
return [self::TYPE_BASH, self::TYPE_ZSH]; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public static function modeList() | ||
{ | ||
return [self::MODE_SIMPLE, self::MODE_FULL]; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getType(): int | ||
{ | ||
return $this->type; | ||
} | ||
|
||
/** | ||
* @param int $type | ||
*/ | ||
public function setType(int $type) | ||
{ | ||
if (\in_array($type, self::typeList(), 1)) { | ||
$this->type = $type; | ||
} | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getMode(): int | ||
{ | ||
return $this->mode; | ||
} | ||
|
||
/** | ||
* @param int $mode | ||
*/ | ||
public function setMode(int $mode) | ||
{ | ||
if (\in_array($mode, self::modeList(), 1)) { | ||
$this->mode = $mode; | ||
} | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Inhere | ||
* Date: 2017/12/22 0022 | ||
* Time: 21:44 | ||
*/ | ||
|
||
namespace Inhere\Console\Components\Formatter; | ||
|
||
/** | ||
* Class Formatter - message formatter | ||
* @package Inhere\Console\Components\Formatter | ||
*/ | ||
class Formatter | ||
{ | ||
|
||
} |
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,19 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Inhere | ||
* Date: 2017/12/22 0022 | ||
* Time: 21:45 | ||
*/ | ||
|
||
namespace Inhere\Console\Components\Formatter; | ||
|
||
/** | ||
* Class HelpPanel | ||
* - method version please {@see \Inhere\Console\Utils\Show::helpPanel()} | ||
* @package Inhere\Console\Components\Formatter | ||
*/ | ||
class HelpPanel extends Formatter | ||
{ | ||
|
||
} |
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,19 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Inhere | ||
* Date: 2017/12/22 0022 | ||
* Time: 21:48 | ||
*/ | ||
|
||
namespace Inhere\Console\Components\Formatter; | ||
|
||
/** | ||
* Class Panel | ||
* - method version please {@see \Inhere\Console\Utils\Show::panel()} | ||
* @package Inhere\Console\Components\Formatter | ||
*/ | ||
class Panel extends Formatter | ||
{ | ||
|
||
} |
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,19 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Inhere | ||
* Date: 2017/12/22 0022 | ||
* Time: 21:43 | ||
*/ | ||
|
||
namespace Inhere\Console\Components\Formatter; | ||
|
||
/** | ||
* Class Table | ||
* - method version please {@see \Inhere\Console\Utils\Show::table()} | ||
* @package Inhere\Console\Components\Formatter | ||
*/ | ||
class Table extends Formatter | ||
{ | ||
|
||
} |
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 |
---|---|---|
|
@@ -16,6 +16,5 @@ | |
*/ | ||
class Pending extends NotifyMessage | ||
{ | ||
/** @var int Speed value. allow 1 - 100 */ | ||
private $speed = 20; | ||
} | ||
|
||
} |
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
Oops, something went wrong.