Skip to content

Commit c9f9eb6

Browse files
committed
soulsetup: add --debug argument
1 parent 66a8fb1 commit c9f9eb6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ Enable detailed debug logging by providing the `--debug` flag:
112112
soulfind --debug
113113
```
114114

115+
```
116+
soulsetup --debug
117+
```
118+
115119

116120
## Authors
117121

src/setup/package.d

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module soulfind.setup;
77
@safe:
88

99
import soulfind.cli : CommandOption, parse_args, print_help, print_version;
10-
import soulfind.defines : default_db_filename, exit_message;
10+
import soulfind.defines : default_db_filename, exit_message, log_db;
1111
import soulfind.setup.setup : Setup;
1212
import std.conv : text;
1313
import std.stdio : writeln;
@@ -16,6 +16,7 @@ int run(string[] args)
1616
{
1717
string db_filename = default_db_filename;
1818
string db_backup_filename;
19+
bool enable_debug;
1920
bool show_version;
2021
bool show_help;
2122

@@ -32,6 +33,10 @@ int run(string[] args)
3233
), "path",
3334
(value) { db_backup_filename = value; }
3435
),
36+
CommandOption(
37+
"", "debug", "Enable debug logging.", null,
38+
(_) { enable_debug = true; }
39+
),
3540
CommandOption(
3641
"v", "version", "Show version.", null,
3742
(_) { show_version = true; }
@@ -59,6 +64,8 @@ int run(string[] args)
5964
return 0;
6065
}
6166

67+
if (enable_debug) log_db = true;
68+
6269
int exit_code;
6370
auto setup = new Setup(db_filename);
6471

0 commit comments

Comments
 (0)