Skip to content

Commit 3dc6e4e

Browse files
committed
up: update some for input parse
Signed-off-by: inhere <in.798@qq.com>
1 parent 513fd1c commit 3dc6e4e

File tree

13 files changed

+410
-97
lines changed

13 files changed

+410
-97
lines changed

resource/templates/bash-completion.tpl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#!/usr/bin/env bash
22
# ------------------------------------------------------------------------------
33
# DATE: {{datetime}}
4-
# FILE: auto-completion.bash
4+
# FILE: {{filename}}
55
# AUTHOR: inhere (https://github.com/inhere)
66
# VERSION: {{version}}
7+
# HOMEPAGE: https://github.com/inhere/php-console
78
# DESCRIPTION: bash shell complete for console app: {{binName}}
89
# ------------------------------------------------------------------------------
9-
# usage: source auto-completion.bash
10+
#
11+
# temp usage:
12+
# source {{filename}}
13+
# add to ~/.bashrc:
14+
# source path/to/{{filename}}
1015
# run 'complete' to see registered complete function.
1116

1217
_complete_for_{{fmtBinName}} () {

resource/templates/zsh-completion.tpl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
# FILE: {{filename}}
55
# AUTHOR: inhere (https://github.com/inhere)
66
# VERSION: {{version}}
7+
# HOMEPAGE: https://github.com/inhere/php-console
78
# DESCRIPTION: zsh shell complete for console app: {{binName}}
89
# ------------------------------------------------------------------------------
9-
# usage: source auto-completion.zsh
10+
#
11+
# temp usage:
12+
# source {{filename}}
13+
# add to ~/.zshrc:
14+
# source path/to/{{filename}}
1015

1116
_complete_for_{{fmtBinName}} () {
1217
local -a commands

src/Component/AutoCompDumper.php

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Component/CompletionDumper.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Inhere\Console\Component;
4+
5+
use Toolkit\Stdlib\Obj;
6+
7+
/**
8+
* Class CompletionDumper
9+
* - Generate auto completion script for zsh/bash/sh shell
10+
*
11+
* @package Inhere\Console\Component
12+
*/
13+
class CompletionDumper extends Obj\AbstractObj
14+
{
15+
}

src/Component/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function handle(Throwable $e, AbstractApplication $app): void
5050
$line = $e->getLine();
5151
$file = $e->getFile();
5252

53-
$snippet = Highlighter::create()->highlightSnippet(file_get_contents($file), $line, 3, 3);
53+
$snippet = Highlighter::create()->snippet(file_get_contents($file), $line, 3, 3);
5454
$message = sprintf(
5555
$tpl, // $e->getCode(),
5656
$e->getMessage(),

0 commit comments

Comments
 (0)