Skip to content

Command line

Given a file named “main.scm” with:

(import (scheme base) (scheme process-context))
(map write-string (command-line))

When I successfully run stak main.scm hello

Then the stdout should contain “hello”.

Given a file named “main.scm” with:

(import (scheme base) (scheme process-context))
(map write-string (command-line))

When I successfully run stak main.scm hello world

Then the stdout should contain “hello”

And the stdout should contain “world”.

Given a file named “main.scm” with:

(import (scheme base) (scheme cxr) (scheme process-context))
(write-string (<procedure> (command-line)))

When I successfully run stak main.scm foo bar baz

Then the stdout should contain “<output>”.

procedure output
cadr foo
caddr bar
cadddr baz

When I successfully run \<command\> --version

Then the stdout should contain “<command> “.

command
stak
stak-compile
stak-repl

Given a file named “main.scm” with:

(import (scheme base))

When I run stak main.scm \<option\>

Then the exit status should be 1

And the stderr should contain “out of memory”.

option
-s 0
–heap-size 0

Given a file named “main.scm” with:

(import (scheme base) (scheme cxr) (scheme process-context))
(write-string (caddr (command-line)))

When I successfully run stak main.scm -- --version

Then the stdout should contain exactly “–version”.