feat: Make it possible to customize completions for specific command and flags
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Dart
- Star
- 54
- Fork
- 6
- Merge trung bình
- 6 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của VeryGoodOpenSource/cli_completion
-
Better shell completionĐang mởfeature p3
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
VeryGoodOpenSource/cli_completion#90 · 1 bình luận · 1 reaction ·
-
feat: CLI-user configurable auto installCó thể làm lại được @vgvbot đã nhận 37 ngày trước và không có pull request nào đang mở. Đang mởfeature p2
VeryGoodOpenSource/cli_completion#55 · 1 bình luận · 1 reaction · 1 người được giao ·
-
feature p2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
VeryGoodOpenSource/cli_completion#47 · 2 bình luận · 2 reaction ·
Tất cả issue của VeryGoodOpenSource/cli_completion
Issue tương tự
-
area-clientside-dartpad
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: 一个小问题反馈,交互按钮的错误与重复Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
firebase/flutterfire#18726 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug claude
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
linagora/tmail-flutter#4878 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày