Skip to content

Commit

Permalink
Don't show dnf5-command hint for unknown options, only commands
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-goode committed Jul 17, 2023
1 parent 35eff24 commit 46267bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dnf5/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ int main(int argc, char * argv[]) try {
}
std::cerr << ex.what() << _(". Add \"--help\" for more information about the arguments.") << std::endl;
if (auto * unknown_arg_ex = dynamic_cast<libdnf5::cli::ArgumentParserUnknownArgumentError *>(&ex)) {
if (unknown_arg_ex->get_command() == "dnf5") {
if (unknown_arg_ex->get_command() == "dnf5" && unknown_arg_ex->get_argument()[0] != '-') {
std::cout << fmt::format(
"It could be a command provided by a plugin, try: dnf install dnf5-command({})",
unknown_arg_ex->get_argument())
Expand Down

0 comments on commit 46267bb

Please sign in to comment.