Commit 78403696 authored by Marc Vef's avatar Marc Vef
Browse files

Merge branch 'fix_cli_help' into 'master'



cli: look for --help flag first

See merge request zdvresearch_bsc/adafs!34

Signed-off-by: default avatarMarc Vef <vef@uni-mainz.de>
parents 73c98bb7 89ecb7b2
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>());
    }