mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-01-22 09:00:44 +08:00
Merge pull request #825 from trapexit/rv
option_parser: return 0 when requesting help or version
This commit is contained in:
commit
668ac4000a
|
@ -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…
Reference in New Issue
Block a user