[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: xdgdirs 1.0
From: |
Andy Wingo |
Subject: |
Re: xdgdirs 1.0 |
Date: |
Sat, 07 Sep 2013 10:36:38 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Just a bunch of random things. No opinion about module names, etc :)
On Thu 05 Sep 2013 12:42, Thien-Thi Nguyen <address@hidden> writes:
> (define mentioned?
> (let ((cl (command-line)))
> (lambda (opt)
> (member opt cl))))
You could do this as (cute member <> (command-line)), having imported
srfi-26.
> (cond ((mentioned? "--help")
> (use-modules (ice-9 documentation))
> (fso "~A~%" (file-commentary (car (command-line))))
> (exit #t)))
Here I think "when" is much more readable. Also, you can use
"(current-file-name)" for a more reliable way to get the current file
name.
> (cond ((mentioned? "--version")
> (fso "xdgdirs ~A~%~A~%" VERSION COPYRIGHT)
> (fso "~A ~A~%~A~%~A~%"
> "License GPLv3+: GNU GPL version 3 or later"
> "<http://gnu.org/licenses/gpl.html>"
> "This is free software: you are free to change and redistribute
> it."
> "There is NO WARRANTY, to the extent permitted by law.")
> (exit #t)))
You can use (ice-9 command-line)'s version-etc.
Regards,
Andy
--
http://wingolog.org/
- xdgdirs 1.0, Thien-Thi Nguyen, 2013/09/05
- Re: xdgdirs 1.0,
Andy Wingo <=