diff options
-rw-r--r-- | Makefile | 3 | ||||
-rwxr-xr-x | bin/ravanan | 13 | ||||
-rw-r--r-- | ravanan/config.scm.in | 10 |
3 files changed, 23 insertions, 3 deletions
@@ -17,6 +17,7 @@ # along with ravanan. If not, see <https://www.gnu.org/licenses/>. project = ravanan +version = 0.1.0 GUILD ?= guild GUILE ?= guile @@ -47,7 +48,7 @@ godir = $(libdir)/guile/$(guile_effective_version)/site-ccache all: $(objects) $(config_file) %.scm: %.scm.in - $(SED) 's|@NODE@|$(NODE)|' $< > $@ + $(SED) -e 's|@PROJECT@|$(project)|' -e 's|@VERSION@|$(version)|' -e 's|@NODE@|$(NODE)|' $< > $@ %.go: %.scm $(config_file) GUILE_AUTO_COMPILE=0 $(GUILD) compile -L . -o $@ $< diff --git a/bin/ravanan b/bin/ravanan index f8fcdf8..af33ba0 100755 --- a/bin/ravanan +++ b/bin/ravanan @@ -30,6 +30,7 @@ exec guile --no-auto-compile -e main -s "$0" "$@" (json) (ravanan batch-system) (ravanan command-line-tool) + (ravanan config) (ravanan reader) (ravanan utils) (ravanan workflow)) @@ -71,7 +72,10 @@ exec guile --no-auto-compile -e main -s "$0" "$@" result))) (option (list "help") #f #t (lambda (opt name arg result) - (acons 'help #t result))))) + (acons 'help #t result))) + (option (list "version") #f #f + (lambda (opt name arg result) + (acons 'version #t result))))) (define (invalid-option opt name arg result) (error "Invalid option" name)) @@ -81,6 +85,8 @@ exec guile --no-auto-compile -e main -s "$0" "$@" "Usage: ~a [OPTIONS] CWL-WORKFLOW INPUTS Run CWL-WORKFLOW with INPUTS. + --version print version and exit + --batch-system=BATCH-SYSTEM batch system to run jobs on; Supported batch systems are single-machine (default) and slurm-api --scratch=SCRATCH path to scratch area on worker nodes @@ -131,6 +137,11 @@ files that have the token in the @verbatim{SLURM_JWT=token} format." (when (assq-ref args 'help) (print-usage program) (exit #t)) + (when (assq-ref args 'version) + (format (current-output-port) + "~a ~a~%" + %project %version) + (exit #t)) ;; Check for required arguments. (unless (assq-ref args 'store) (error "ravanan store not specified")) diff --git a/ravanan/config.scm.in b/ravanan/config.scm.in index ed90176..c462749 100644 --- a/ravanan/config.scm.in +++ b/ravanan/config.scm.in @@ -17,7 +17,15 @@ ;;; along with ravanan. If not, see <https://www.gnu.org/licenses/>. (define-module (ravanan config) - #:export (%node)) + #:export (%project + %version + %node)) + +(define %project + "@PROJECT@") + +(define %version + "@VERSION@") (define %node "@NODE@") |