aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorArun Isaac2024-08-22 17:22:01 +0100
committerArun Isaac2024-08-22 17:24:43 +0100
commitbec69bbea36df14b39d8a0332322438fafee49b7 (patch)
tree6e14a8817ab0aeff785c460b655934ce2fa3d427 /bin
parent62e8278a3dc742b37080d719329b9aa4426cee2d (diff)
downloadravanan-bec69bbea36df14b39d8a0332322438fafee49b7.tar.gz
ravanan-bec69bbea36df14b39d8a0332322438fafee49b7.tar.lz
ravanan-bec69bbea36df14b39d8a0332322438fafee49b7.zip
bin: Add --help flag.
* bin/ravanan (print-usage): New function. (main): Use print-usage.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ravanan34
1 files changed, 32 insertions, 2 deletions
diff --git a/bin/ravanan b/bin/ravanan
index d823173..2072a51 100755
--- a/bin/ravanan
+++ b/bin/ravanan
@@ -54,14 +54,41 @@ exec guile --no-auto-compile -e main -s "$0" "$@"
(acons 'slurm-api-endpoint arg result)))
(option (list "slurm-jwt") #t #f
(lambda (opt name arg result)
- (acons 'slurm-jwt arg result)))))
+ (acons 'slurm-jwt arg result)))
+ (option (list "help") #f #t
+ (lambda (opt name arg result)
+ (acons 'help #t result)))))
(define (invalid-option opt name arg result)
(error "Invalid option" name))
+(define (print-usage program)
+ (format (current-error-port)
+ "Usage: ~a [OPTIONS] CWL-WORKFLOW INPUTS
+Run CWL-WORKFLOW with INPUTS.
+
+ --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
+ scratch need not be shared
+ (default: current directory with the single-machine batch system)
+ --store=STORE path to shared store to write results into
+
+Guix options:
+
+ --guix-daemon-socket=GUIX_DAEMON_SOCKET guix daemon to connect to
+ --guix-manifest=GUIX_MANIFEST guix manifest to run jobs with
+
+Slurm API batch system options:
+
+ --slurm-api-endpoint=SLURM-API-ENDPOINT slurm API endpoint to connect to
+ --slurm-jwt=SLURM-JWT slurm JWT to authenticate with
+"
+ program))
+
(define main
(match-lambda
- ((_ args ...)
+ ((program args ...)
(let ((args (args-fold args
%options
invalid-option
@@ -75,6 +102,9 @@ exec guile --no-auto-compile -e main -s "$0" "$@"
(slurm-api-endpoint . ,(build-uri 'http
#:host "localhost"
#:port 6820))))))
+ (when (assq-ref args 'help)
+ (print-usage program)
+ (exit #t))
;; Check for required arguments.
(unless (assq-ref args 'store)
(error "ravanan store not specified"))