Skip to content

Commit

Permalink
qtxdg-mat: Improve file manager command line handling
Browse files Browse the repository at this point in the history
Handle arguments given without options.
  • Loading branch information
luis-pereira committed Jul 28, 2021
1 parent dcac08a commit 2fa794d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tools/mat/deffilemanagermatcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ static CommandLineParseResult parseCommandLine(QCommandLineParser *parser, DefFi
return CommandLineError;
}

if (!isDefFileManagerNameSet && !posArgs.empty()) {
*errorMessage = QSL("To set the default file manager use the -s/--set option");
return CommandLineError;
}

if (isListAvailableSet && (isDefFileManagerNameSet || !posArgs.empty())) {
*errorMessage = QSL("list-available can't be used with other options and doesn't take arguments");
return CommandLineError;
Expand Down

0 comments on commit 2fa794d

Please sign in to comment.