about summary refs log tree commit diff
path: root/fun
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-29T10·11+0000
committerVincent Ambo <tazjin@google.com>2020-01-29T10·12+0000
commit10e2e56b67b41eb6315fdc4cc1bc161f43440dad (patch)
treef2a37562e71b850bb7c0f013559da25bce3c4fed /fun
parent6f728f33a674ce668ded32af9a272ff21b182164 (diff)
refactor(fun/wcl): Use portable unix-opts library r/475
unix-opts, imported into buildLisp.nix in the previous commit,
provides an implementation independent way of parsing command line
arguments.
Diffstat (limited to 'fun')
-rw-r--r--fun/wcl/default.nix1
-rw-r--r--fun/wcl/wc.lisp2
2 files changed, 2 insertions, 1 deletions
diff --git a/fun/wcl/default.nix b/fun/wcl/default.nix
index 17367f3d80..ca1cbb8058 100644
--- a/fun/wcl/default.nix
+++ b/fun/wcl/default.nix
@@ -8,6 +8,7 @@ pkgs.nix.buildLisp.program {
   ];
 
   deps = with pkgs.third_party.lisp; [
+    unix-opts
     iterate
   ];
 }
diff --git a/fun/wcl/wc.lisp b/fun/wcl/wc.lisp
index 81576d41aa..83c7e8c4f1 100644
--- a/fun/wcl/wc.lisp
+++ b/fun/wcl/wc.lisp
@@ -5,7 +5,7 @@
 (declaim (optimize (speed 3) (safety 0)))
 
 (defun main ()
-  (let ((filename (cadr sb-ext:*posix-argv*))
+  (let ((filename (cadr (opts:argv)))
         (space (char-code #\Space))
         (newline (char-code #\Newline)))
     (with-open-file (file-stream filename :element-type '(unsigned-byte 8))