mirror of https://github.com/trapexit/mergerfs.git
3 changed files with 113 additions and 0 deletions
@ -0,0 +1,72 @@ |
|||
#include "mfm.hpp"
|
|||
|
|||
#include "mfm_options.hpp"
|
|||
|
|||
#include "CLI11.hpp"
|
|||
|
|||
static |
|||
void |
|||
_setup_argparser_dup(CLI::App &app_, |
|||
mfm::Opts::Dup &opts_) |
|||
{ |
|||
|
|||
} |
|||
|
|||
static |
|||
void |
|||
_setup_argparser_watch(CLI::App &app_, |
|||
mfm::Opts::Watch &opts_) |
|||
{ |
|||
|
|||
} |
|||
|
|||
static |
|||
void |
|||
_setup_argparser_migrate(CLI::App &app_, |
|||
mfm::Opts::Migrate &opts_) |
|||
{ |
|||
|
|||
} |
|||
|
|||
static |
|||
void |
|||
_setup_argparser_rebalance(CLI::App &app_, |
|||
mfm::Opts::Rebalance &opts_) |
|||
{ |
|||
|
|||
} |
|||
|
|||
static |
|||
void |
|||
_setup_argparser(CLI::App &app_, |
|||
mfm::Opts &opts_) |
|||
{ |
|||
_setup_argparser_dup(app_,opts_.dup); |
|||
_setup_argparser_migrate(app_,opts_.migrate); |
|||
_setup_argparser_rebalance(app_,opts_.rebalance); |
|||
_setup_argparser_watch(app_,opts_.watch); |
|||
} |
|||
|
|||
int |
|||
mfm::main(int argc_, |
|||
char **argv_) |
|||
{ |
|||
CLI::App app; |
|||
mfm::Opts opts; |
|||
|
|||
app.description("mfm: mergerfs filesystem manager"); |
|||
app.name("USAGE:: mfm"); |
|||
|
|||
::_setup_argparser(app,opts); |
|||
|
|||
try |
|||
{ |
|||
app.parse(argc_,argv_); |
|||
} |
|||
catch(const CLI::ParseError &e_) |
|||
{ |
|||
return app.exit(e_); |
|||
} |
|||
|
|||
return 0; |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
#pragma once
|
|||
|
|||
namespace mfm |
|||
{ |
|||
int main(int argc, |
|||
char **argv); |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
#pragma once
|
|||
|
|||
#include "int_types.h"
|
|||
|
|||
#include <filesystem>
|
|||
#include <string>
|
|||
#include <vector>
|
|||
|
|||
namespace mfm |
|||
{ |
|||
struct Opts |
|||
{ |
|||
struct Dup |
|||
{ |
|||
std::filesystem::path dirpath; |
|||
} dup; |
|||
|
|||
struct Watch |
|||
{ |
|||
std::filesystem::path path; |
|||
} watch; |
|||
|
|||
struct Migrate |
|||
{ |
|||
std::vector<std::filesystem::path> src; |
|||
std::vector<std::filesystem::path> dst; |
|||
} migrate; |
|||
|
|||
struct Rebalance |
|||
{ |
|||
std::vector<std::filesystem::path> dirpaths; |
|||
} rebalance; |
|||
}; |
|||
}; |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue