Browse Source

Merge pull request #825 from trapexit/rv

option_parser: return 0 when requesting help or version
pull/827/head
trapexit 4 years ago
committed by GitHub
parent
commit
668ac4000a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      src/option_parser.cpp

16
src/option_parser.cpp

@ -129,7 +129,8 @@ namespace l
else
{
l::read_config(data_,is);
if(is.fail())
data_->errs->push_back("failure reading config file");
is.close();
}
}
@ -426,17 +427,13 @@ option_processor(void *data_,
case MERGERFS_OPT_HELP:
usage();
close(2);
dup(1);
fuse_opt_add_arg(outargs_,"-ho");
break;
exit(0);
case MERGERFS_OPT_VERSION:
std::cout << "mergerfs version: "
<< (MERGERFS_VERSION[0] ? MERGERFS_VERSION : "unknown")
<< std::endl;
fuse_opt_add_arg(outargs_,"--version");
break;
exit(0);
default:
break;
@ -470,6 +467,11 @@ namespace options
opts,
::option_processor);
if(config_->branches.vec.empty())
errs_->push_back("branches not set");
if(config_->mount->empty())
errs_->push_back("mountpoint not set");
set_default_options(args_);
set_fsname(args_,config_);
set_subtype(args_);

Loading…
Cancel
Save