aboutsummaryrefslogtreecommitdiff
path: root/examples/arguments.sloth
diff options
context:
space:
mode:
Diffstat (limited to 'examples/arguments.sloth')
-rw-r--r--examples/arguments.sloth9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/arguments.sloth b/examples/arguments.sloth
new file mode 100644
index 0000000..3e44dcc
--- /dev/null
+++ b/examples/arguments.sloth
@@ -0,0 +1,9 @@
+fn main(argc: Int, argv: [String]) Int {
+ if argc == 2 {
+ print("The argument supplied is ");
+ println(argv);
+ } else {
+ println("Wrong # of args");
+ }
+ return 0;
+}