A working example of CLI command you can use to create your own command line app.
- Set your PATH environment variable
so you can use
racoand other Racket command line functions. - either look for
from-templatein the DrRacket menu File|Package Manager, or run theracocommand:
raco pkg install from-templateraco new cli-command <destination-dir>If you omit <destination-dir>, the command will add copy the template to a folder called cli-command in the current folder.
This is working example that you can change to suit your needs.
If you need to create an interactive app consider using the charterm package.
$ raco exe -o hello hello.rkt
This will create an executabe hello or hello.exe depending on your platform.
For help
$ ./hello -h or hello.exe -h
Creating executables: https://docs.racket-lang.org/raco/exe.html
Command-line parsing: https://docs.racket-lang.org/reference/Command-Line_Parsing.html
Use the DrRacket drracket-cmdline-args plugin: https://docs.racket-lang.org/drracket-cmdline-args/
Install: raco pkg install drracket-cmdline-args
