mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-14 15:47:14 +03:00
Allow database file path to be passed as the first command line argument to the app
This adds support for directly opening files with the DHT app, for ex. in Windows Explorer by using "Open With", or by associating the ".dht" extension with the app.
This commit is contained in:
parent
6d3db23f80
commit
9a7a2cffc2
@ -14,13 +14,19 @@ namespace DHT.Desktop {
|
||||
public Arguments(string[] args) {
|
||||
for (int i = 0; i < args.Length; i++) {
|
||||
string key = args[i];
|
||||
string value;
|
||||
|
||||
if (i >= args.Length - 1) {
|
||||
if (i == 0 && !key.StartsWith('-')) {
|
||||
value = key;
|
||||
key = "-db";
|
||||
}
|
||||
else if (i >= args.Length - 1) {
|
||||
Log.Warn("Missing value for command line argument: " + key);
|
||||
continue;
|
||||
}
|
||||
|
||||
string value = args[++i];
|
||||
else {
|
||||
value = args[++i];
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
case "-db":
|
||||
|
Loading…
x
Reference in New Issue
Block a user