mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-24 17:06:24 -05:00
Error when given invalid policy names
This commit is contained in:
parent
faadeb75e0
commit
46ce28b149
5 changed files with 30 additions and 6 deletions
|
|
@ -42,7 +42,7 @@ Category::Base::to_string(void) const
|
|||
{
|
||||
std::set<std::string> rv;
|
||||
|
||||
for(auto func : funcs)
|
||||
for(const auto func : funcs)
|
||||
rv.insert(func->to_string());
|
||||
|
||||
return str::join(rv,',');
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ int
|
|||
Func::Base::Action::from_string(const std::string &policyname_)
|
||||
{
|
||||
policy = Policies::Action::find(policyname_);
|
||||
if(!policy)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -37,6 +39,8 @@ int
|
|||
Func::Base::Create::from_string(const std::string &policyname_)
|
||||
{
|
||||
policy = Policies::Create::find(policyname_);
|
||||
if(!policy)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -51,6 +55,8 @@ int
|
|||
Func::Base::Search::from_string(const std::string &policyname_)
|
||||
{
|
||||
policy = Policies::Search::find(policyname_);
|
||||
if(!policy)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,7 +164,10 @@ namespace l
|
|||
|
||||
options::parse(&args,&errs);
|
||||
if(errs.size())
|
||||
std::cerr << errs << std::endl;
|
||||
{
|
||||
std::cerr << errs << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
l::setup_resources();
|
||||
l::get_fuse_operations(ops,cfg->nullrw);
|
||||
|
|
|
|||
|
|
@ -73,6 +73,11 @@ namespace Policy
|
|||
return (*impl)(branches_,fusepath_.c_str(),paths_);
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return (bool)impl;
|
||||
}
|
||||
|
||||
private:
|
||||
ActionImpl *impl;
|
||||
};
|
||||
|
|
@ -134,6 +139,11 @@ namespace Policy
|
|||
return (*impl)(branches_,fusepath_.c_str(),paths_);
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return (bool)impl;
|
||||
}
|
||||
|
||||
private:
|
||||
CreateImpl *impl;
|
||||
};
|
||||
|
|
@ -188,6 +198,11 @@ namespace Policy
|
|||
return (*impl)(branches_,fusepath_.c_str(),paths_);
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return (bool)impl;
|
||||
}
|
||||
|
||||
private:
|
||||
SearchImpl *impl;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue