;;; Hoot
;;; Copyright (C) 2026 Andy Wingo <wingo@igalia.com>
;;;
;;; Licensed under the Apache License, Version 2.0 (the "License");
;;; you may not use this file except in compliance with the License.
;;; You may obtain a copy of the License at
;;;
;;;    http://www.apache.org/licenses/LICENSE-2.0
;;;
;;; Unless required by applicable law or agreed to in writing, software
;;; distributed under the License is distributed on an "AS IS" BASIS,
;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;;; See the License for the specific language governing permissions and
;;; limitations under the License.

;;; Commentary:
;;;
;;; Helpers for Hoot CLI.
;;;
;;; Code:

(define-module (hoot cli)
  #:use-module (hoot config)
  #:use-module (srfi srfi-37)
  #:export (print-version
            %version-option))

(define* (print-version #:optional (port (current-output-port)))
  (format port "hoot (Hoot) ~a
Part of the Hoot WebAssembly toolkit for Scheme:
  https://spritely.institute/hoot

Licensed under the Apache License, Version 2.0:
  http://www.apache.org/licenses/LICENSE-2.0
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
" %version))

(define %version-option
  (option '(#\v "version") #f #f
          (lambda (opt name arg result)
            (print-version)
            (exit 0))))
