Skip to content

Commit 1679da2

Browse files
committed
Process shell arguments
1 parent 9679e7b commit 1679da2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: src/CommandProcessor.cs

+16
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ public static class CommandProcessor
99

1010
public static void Process(List<string> args)
1111
{
12+
if (File.Exists(args[0])) {
13+
WindowHelper.SetWindowMode(WindowMode.Hidden);
14+
ProcessShellInput(args[0]);
15+
return;
16+
}
17+
1218
if (args[0].AsFlag() == 'h') {
1319
Console.WriteLine("""
1420
Compress a file:
@@ -44,6 +50,16 @@ public static char AsFlag(this string input)
4450
return input[input.LastIndexOf('-') + 1];
4551
}
4652

53+
public static void ProcessShellInput(string input)
54+
{
55+
if (input.EndsWith(".zs")) {
56+
Decompress(input, new());
57+
}
58+
else {
59+
Compress(input, new());
60+
}
61+
}
62+
4763
public static void Compress(string input, Dictionary<char, string> flags)
4864
{
4965
flags.TryGetValue('o', out string? output);

0 commit comments

Comments
 (0)