Unverified Commit 89ecb7b2 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

cli: look for --help flag first

Since the introduction of required parameters wasn't possible to show
the help message.
In fact the --help flag was checked after all other parameters.
parent 5f4cecbf
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -341,6 +341,11 @@ int main(int argc, const char* argv[]) {
    po::variables_map vm;
    po::store(po::parse_command_line(argc, argv, desc), vm);

    if (vm.count("help")) {
        cout << desc << "\n";
        return 1;
    }
    
    try {
        po::notify(vm);
    } catch (po::required_option& e) {
@@ -348,10 +353,6 @@ int main(int argc, const char* argv[]) {
        return 1;
    }

    if (vm.count("help")) {
        cout << desc << "\n";
        return 1;
    }
    if (vm.count("mountdir")) {
        ADAFS_DATA->mountdir(vm["mountdir"].as<string>());
    }