views:

86

answers:

1

How do I detect what command line arguments where given when a script is run with mred? That is, the equivalent of sys.argv in Python, args[] in Java, etc...

+1  A: 

You have these choices (you can look them all up in the docs for more info):

  • current-command-line-arguments -- a vector holding the command line arguments

  • You can start a script with the -m flag, which will require the file and look for a provided main function, then apply it on the command-line arguments (as a list of strings)

  • Or you can require the scheme/cmdline which provides a macro that can be used to define several flags in a convenient way.

Eli Barzilay