mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-03 14:32:24 +02:00
move verbose check to first getopt to make it available early on
This commit is contained in:
parent
ab918dd82d
commit
3aff2e8251
11
src/config.d
11
src/config.d
|
@ -47,7 +47,7 @@ final class Config
|
||||||
boolValues["debug_https"] = false;
|
boolValues["debug_https"] = false;
|
||||||
boolValues["skip_dotfiles"] = false;
|
boolValues["skip_dotfiles"] = false;
|
||||||
boolValues["dry_run"] = false;
|
boolValues["dry_run"] = false;
|
||||||
longValues["verbose"] = 0;
|
longValues["verbose"] = log.verbose; // might be initialized by the first getopt call!
|
||||||
longValues["monitor_interval"] = 45,
|
longValues["monitor_interval"] = 45,
|
||||||
longValues["min_notif_changes"] = 5;
|
longValues["min_notif_changes"] = 5;
|
||||||
longValues["min_notif_changes"] = 5;
|
longValues["min_notif_changes"] = 5;
|
||||||
|
@ -161,6 +161,7 @@ final class Config
|
||||||
try {
|
try {
|
||||||
string tmpStr;
|
string tmpStr;
|
||||||
bool tmpBol;
|
bool tmpBol;
|
||||||
|
long tmpVerb;
|
||||||
auto opt = getopt(
|
auto opt = getopt(
|
||||||
args,
|
args,
|
||||||
std.getopt.config.bundling,
|
std.getopt.config.bundling,
|
||||||
|
@ -252,13 +253,13 @@ final class Config
|
||||||
"upload-only",
|
"upload-only",
|
||||||
"Only upload to OneDrive, do not sync changes from OneDrive locally",
|
"Only upload to OneDrive, do not sync changes from OneDrive locally",
|
||||||
&boolValues["upload_only"],
|
&boolValues["upload_only"],
|
||||||
"verbose|v+",
|
|
||||||
"Print more details, useful for debugging (repeat for extra debugging)",
|
|
||||||
&longValues["verbose"],
|
|
||||||
// duplicated from main.d to get full help output!
|
// duplicated from main.d to get full help output!
|
||||||
"confdir",
|
"confdir",
|
||||||
"Set the directory used to store the configuration files",
|
"Set the directory used to store the configuration files",
|
||||||
&tmpStr,
|
&tmpStr,
|
||||||
|
"verbose|v+",
|
||||||
|
"Print more details, useful for debugging (repeat for extra debugging)",
|
||||||
|
&tmpVerb,
|
||||||
"version",
|
"version",
|
||||||
"Print the version and exit",
|
"Print the version and exit",
|
||||||
&tmpBol
|
&tmpBol
|
||||||
|
@ -268,8 +269,6 @@ final class Config
|
||||||
outputLongHelp(opt.options);
|
outputLongHelp(opt.options);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
// update verbosity setting
|
|
||||||
log.verbose = longValues["verbose"];
|
|
||||||
} catch (GetOptException e) {
|
} catch (GetOptException e) {
|
||||||
log.error(e.msg);
|
log.error(e.msg);
|
||||||
log.error("Try 'onedrive -h' for more information");
|
log.error("Try 'onedrive -h' for more information");
|
||||||
|
|
|
@ -31,6 +31,7 @@ int main(string[] args)
|
||||||
std.getopt.config.bundling,
|
std.getopt.config.bundling,
|
||||||
std.getopt.config.caseSensitive,
|
std.getopt.config.caseSensitive,
|
||||||
"confdir", "Set the directory used to store the configuration files", &confdirOption,
|
"confdir", "Set the directory used to store the configuration files", &confdirOption,
|
||||||
|
"verbose|v+", "Print more details, useful for debugging (repeat for extra debugging)", &log.verbose,
|
||||||
"version", "Print the version and exit", &printVersion
|
"version", "Print the version and exit", &printVersion
|
||||||
);
|
);
|
||||||
if (opt.helpWanted) {
|
if (opt.helpWanted) {
|
||||||
|
|
Loading…
Reference in a new issue