strip comments from input
06ce0a853894c4c56d0ed17637e234113d1305df
2 files changed
src/MongoCli/ParseHelper.cssrc/MongoCli/Program.cs
diff --git a/src/MongoCli/ParseHelper.cs b/src/MongoCli/ParseHelper.cs
index b9221b5..f652fab 100644
--- a/src/MongoCli/ParseHelper.cs
+++ b/src/MongoCli/ParseHelper.cs
@@ -12,7 +12,7 @@ public class FunctionArguments
public FunctionArguments()
{
this.Name = string.Empty;
- this.Arguments = new();
+ this.Arguments = [];
}
}
public static class ParseHelper
diff --git a/src/MongoCli/Program.cs b/src/MongoCli/Program.cs
index 427f119..7eedf9c 100644
--- a/src/MongoCli/Program.cs
+++ b/src/MongoCli/Program.cs
@@ -154,6 +154,10 @@ class Program
if (line == "exit" || line == null)
break;
+ var comment = line.IndexOf("//");
+ if(comment>=0)
+ line = line[..comment].Trim();
+
if (!string.IsNullOrWhiteSpace(line))
history.Add(line);