Skip to content

Commit c5fa8f9

Browse files
committed
cpp w/ fraglet arg support
1 parent c9162ef commit c5fa8f9

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

cpp/files/hello-world.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -e
44

55
cd /hello-world
66
g++ -o hello hello-world.cpp || exit 1
7-
./hello
7+
./hello "$@"

cpp/fraglet/verify.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,15 @@ int main() {
8585
}
8686
EOF
8787

88+
# Example 7: Argument passing
89+
echo "Testing argument passing..."
90+
fragletc --image "$IMAGE" - arg1 arg2 <<'EOF' 2>&1 | grep -q "First: arg1"
91+
#include <iostream>
92+
int main(int argc, char *argv[]) {
93+
if (argc > 1) std::cout << "First: " << argv[1] << std::endl;
94+
if (argc > 2) std::cout << "Second: " << argv[2] << std::endl;
95+
return 0;
96+
}
97+
EOF
98+
8899
echo "✓ All tests passed"

0 commit comments

Comments
 (0)