pman/make/main.scm
Jacob Hrbek 0bc136cf3a
Sync
Signed-off-by: Jacob Hrbek <kreyren@rixotstudio.cz>
2022-08-28 20:02:07 +02:00

47 lines
1.8 KiB
Scheme

;;; The Project Manager ("pman") -- GNU Guile-based solution for project management
;;; Copyright (C) 2021 Mike Gran <spk121@yahoo.com>
;;; Copyright (C) 2022 Jacob Hrbek <kreyren@rixotstudio.cz>
;;;
;;; The Project Manager is a Free/Libre Open-Source Software; you can redistribute it and/or modify it under the terms of the MIT License as published by the Massachusetts Institute of Technology
;;;
;;; This project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MIT License for more details.
;;;
;;; You should have received a copy of the MIT License along with the project. If not, see <https://mit-license.org>.
(define-module (make main)
#:use-module (ice-9 getopt-long)
#:export (main))
;;; Commentary:
;;;
;;; Backend for the `pmake` command to process the command line arguments using the standardized 'getopts-long' as described in the GNU Guile reference manual <https://www.gnu.org/software/guile/manual/html_node/getopt_002dlong.html>.
;;;
;;; Code:
;; FIXME-QA(Krey): Is this even needed?
;; Declare exit codes
(define EXIT_SUCCESS 0)
(define EXIT_NOT_UP_TO_DATE 1)
(define EXIT_FAILURE 2)
(define option-spec
'((environment-overrides (single-char #\e))
(makefile (single-char #\f) (value #t))
(ignore-errors (single-char #\i))
(keep-going (single-char #\k))
(dry-run (single-char #\n))
(print-data-base (single-char #\p))
(question (single-char #\q))
(no-builtin-rules (single-char #\r))
(stop (single-char #\S))
(silent (single-char #\s))
(touch (single-char #\t))))
(define (main args)
(let ((options (getopt-long args option-spec)))
(write options)
(newline)
EXIT_SUCCESS))
;;; make.scm ends here