feat: Make it possible to customize completions for specific command and flags
まだ誰も着手していません。
評価
調査の方向性
Start by reading the existing CompletionCommand behavior and how command and flag completions are currently produced; the issue names no files or tests. Done means a command such as foo install can provide its own version completions, with the behavior defined for its flags and verified against the expected tab-completion output.
索引モデルが issue の本文から書いたものです。
説明
Description
I would like to have control over the completions that displayed for my command.
Let's say I have a command foo install <version>. This command also has 2 flags --dry-run and --help.
Current state
Only the flags are suggested:
$ foo install <TAB>
--help -- Print this usage information.
--dry-run -- Perform prechecks but do not install.
Expected state
$ foo install <TAB>
2.1.0
2.0.0
1.2.0
1.1.0
1.0.1
1.0.0
API idea:
/// Installs Flutter SDK
class InstallCommand extends CompletionCommand<int> {
@override
final name = 'install';
@override
final description = 'Installs foo version';
/// Returns the string that will be returned when tab completion
/// is called for this command.
///
/// This method should return fast for good user experience.
@override
Future<String> completions() {
print(MyFooVersionProvider.listAllVersions());
// The above line would print:
// 2.1.0
// 2.0.0
// 1.2.0
// 1.1.0
// 1.0.1
// 1.0.0
}
@override
Future<int> run() async { /** code **/ }
Additional Context
A similar CLI package in the Go ecosystem has this feature. See docs.
- 主要言語
- Dart
- スター
- 54
- フォーク
- 6
- 平均マージ
- 6日 17時間
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
VeryGoodOpenSource/cli_completion のほかの issue
-
feature p3
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
VeryGoodOpenSource/cli_completion#90 · コメント 1 件 · リアクション 1 件 ·
-
feature p2
VeryGoodOpenSource/cli_completion#55 · コメント 1 件 · リアクション 1 件 · 担当者 1 名 ·
-
feature p2
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
VeryGoodOpenSource/cli_completion#47 · コメント 2 件 · リアクション 2 件 ·
VeryGoodOpenSource/cli_completion の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
from.page-issue
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
[Super Editor][Chat] - Floating editor scaffold does not reset panel height after closing panel オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
status: needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
a2ui-project/a2ui#2763 ·