Add shell completion for why-depends

Fixes #5806
This commit is contained in:
Naïm Favier 2021-12-20 19:57:48 +01:00
parent 6e6e998930
commit 1827cf5a9b
No known key found for this signature in database
GPG key ID: 49B07322580B7EE2

View file

@ -34,8 +34,21 @@ struct CmdWhyDepends : SourceExprCommand
CmdWhyDepends() CmdWhyDepends()
{ {
expectArg("package", &_package); expectArgs({
expectArg("dependency", &_dependency); .label = "package",
.handler = {&_package},
.completer = {[&](size_t, std::string_view prefix) {
completeInstallable(prefix);
}}
});
expectArgs({
.label = "dependency",
.handler = {&_dependency},
.completer = {[&](size_t, std::string_view prefix) {
completeInstallable(prefix);
}}
});
addFlag({ addFlag({
.longName = "all", .longName = "all",