Skip to content

Commit c9162ef

Browse files
committed
csharp fraglet to support args
And clean up that banner garbage.
1 parent 56ed495 commit c9162ef

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

csharp/files/hello-world.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env sh
22

3+
set -e
4+
5+
export DOTNET_NOLOGO=1
36
cd /hello-world
4-
dotnet run
7+
dotnet run -- "$@"

csharp/fraglet/verify.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class Program {
6565
public static T Maximum<T>(T a, T b) where T : IComparable<T> {
6666
return a.CompareTo(b) > 0 ? a : b;
6767
}
68-
68+
6969
public static void Main() {
7070
Console.WriteLine($"Max(5, 10) = {Maximum(5, 10)}");
7171
Console.WriteLine($"Max(3.14, 2.71) = {Maximum(3.14, 2.71)}");
@@ -80,4 +80,11 @@ var evens = numbers.Where(n => n % 2 == 0);
8080
Console.WriteLine($"Even numbers: {string.Join(", ", evens)}");
8181
EOF
8282

83+
# Example 8: Argument passing
84+
echo "Testing argument passing..."
85+
fragletc --image "$IMAGE" - arg1 arg2 <<'EOF' 2>&1 | grep -q "arg1 arg2"
86+
string message = args.Length > 0 ? string.Join(" ", args) : "Hello World!";
87+
Console.WriteLine(message);
88+
EOF
89+
8390
echo "✓ All tests passed"

0 commit comments

Comments
 (0)