all repos — min @ 435af004eb27b9d60cb97f99a9b40a4e48c73986

A small but practical concatenative programming language.

run.min

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
#!/usr/bin/env min

; Validation
(args size 2 <) ("No task specified" error 1 exit) when

args 1 get ":" split =taskspec
taskspec 0 get :task
"default" :subtask
(taskspec size 1 >) (taskspec 1 get @subtask) when

"./tasks/$#.min" (task) =% :task-file

(task-file exists? not) ("Task '$1' does not exist" (task) =% error 2 exit) when

; Load task module
task-file load

; Execute task
"$#-tasks" (task) =% eval subtask ^