From 3094f9b7912ede3f5fc85d97feab1b327960df12 Mon Sep 17 00:00:00 2001 From: Dale Mellor Date: Sat, 26 Jan 2008 10:50:59 +0000 Subject: Allow files named on command line to have arbitrary names (assume guile input format). --- ChangeLog | 4 ++++ main.scm | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8fb1eb7..4e364b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-01-25 Dale Mellor > + * main.scm (command-type): Files which are listed on the command + line are assumed to be guile configurations if they do not end in + .guile or .vixie (previously they were silently ignored). + * main.scm: Argument to --schedule is no longer optional (the options system goes really screwy with optional values, usually pulling the first non-option argument as a value if one was not diff --git a/main.scm b/main.scm index 9424736..f1269d0 100644 --- a/main.scm +++ b/main.scm @@ -283,15 +283,16 @@ Report bugs to " config-package-bugreport ".\n (define guile-file-regexp (make-regexp "\\.gui(le)?$")) (define vixie-file-regexp (make-regexp "\\.vix(ie)?$")) -(define (process-user-file file-path) +(define (process-user-file file-path . assume-guile) (cond ((string=? file-path "-") (if (string=? (option-ref options 'stdin "guile") "vixie") (read-vixie-port (current-input-port)) (eval-string (stdin->string)))) - ((regexp-exec guile-file-regexp file-path) - (load file-path)) + ((or (not (null? assume-guile)) + (regexp-exec guile-file-regexp file-path)) + (load file-path)) ((regexp-exec vixie-file-regexp file-path) - (read-vixie-file file-path)))) + (read-vixie-file file-path)))) @@ -368,7 +369,7 @@ Report bugs to " config-package-bugreport ".\n ((mcron) (if (null? (option-ref options '() '())) (process-files-in-user-directory) (for-each (lambda (file-path) - (process-user-file file-path)) + (process-user-file file-path #t)) (option-ref options '() '())))) ((cron) (process-files-in-system-directory) -- cgit v1.2.3