-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext.hpp
More file actions
28 lines (25 loc) · 976 Bytes
/
context.hpp
File metadata and controls
28 lines (25 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#include <string>
#include <list>
#include <variant>
using option = std::variant<std::monostate, int64_t*, std::string*, std::list<std::string>*>;
struct Context {
enum class Format { None, Year, Month, Day };
enum class Action { None, Move, Hard, Soft };
std::list<std::string> dirs, prefer, avoid, keys;
std::string out, dups; // recovery working an move target directory
int64_t count, skip; // counters for limited output
bool recurse, force, sup, all, help;
Action action;
static bool verbose, debug, confirm;
Format format;
Context();
bool suppress() const { return sup && !verbose; }
void parse(int, char**);
void set(option*, const char*);
bool dryrun() const { return action == Action::None; }
bool move() const { return action == Action::Move; }
bool hard() const { return action == Action::Hard; }
bool soft() const { return action == Action::Soft; }
};
std::ostream& operator<<(std::ostream&, const Context&);