mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-03 21:30:11 -05:00
checkpoint
This commit is contained in:
parent
d88731a380
commit
907dddb0ca
3 changed files with 113 additions and 0 deletions
72
src/mfm.cpp
Normal file
72
src/mfm.cpp
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
7
src/mfm.hpp
Normal file
7
src/mfm.hpp
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace mfm
|
||||||
|
{
|
||||||
|
int main(int argc,
|
||||||
|
char **argv);
|
||||||
|
}
|
||||||
34
src/mfm_options.hpp
Normal file
34
src/mfm_options.hpp
Normal file
|
|
@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue