diff options
author | Case Duckworth | 2023-09-08 12:28:25 -0500 |
---|---|---|
committer | Case Duckworth | 2023-09-08 12:28:25 -0500 |
commit | bc1ba43d2e23ff6674c92f4cd1ab5fb3b1a673ec (patch) | |
tree | bf7f82ceed01524e75474fc93e2f6e52eb083a15 /cock.scm | |
download | cock-main.tar.gz cock-main.zip |
first commit main
Diffstat (limited to 'cock.scm')
-rw-r--r-- | cock.scm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cock.scm b/cock.scm new file mode 100644 index 0000000..d01c7e9 --- /dev/null +++ b/cock.scm | |||
@@ -0,0 +1,21 @@ | |||
1 | (import (cock) | ||
2 | (chicken process-context)) | ||
3 | |||
4 | (define (main args) | ||
5 | (define root (current-directory)) | ||
6 | (define port 8000) | ||
7 | (let loop ((args args)) | ||
8 | (cond | ||
9 | ((null? args) (serve root port)) | ||
10 | ((equal? (car args) "-p") | ||
11 | (set! port (cadr args)) | ||
12 | (loop (cddr args))) | ||
13 | (else | ||
14 | (set! root (car args)) | ||
15 | ;; Stop processing arguments | ||
16 | (loop '()))))) | ||
17 | |||
18 | (cond-expand | ||
19 | ((or chicken-script compiling) | ||
20 | (main (command-line-arguments))) | ||
21 | (else)) | ||