mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 06:50:31 +02:00
Improve output of command-line errors.
* module/ice-9/command-line.scm (shell-usage): Add 'newline' call when FMT is true. (compile-shell-switches)[error]: Prepend "error: " and append "~%" to FMT. Use a lower-case message.
This commit is contained in:
parent
01a301d1b6
commit
e1d29ee4f7
1 changed files with 7 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
;;; Parsing Guile's command-line
|
||||
|
||||
;;; Copyright (C) 1994-1998, 2000-2011, 2012, 2013, 2014 Free Software Foundation, Inc.
|
||||
;;; Copyright (C) 1994-1998, 2000-2015 Free Software Foundation, Inc.
|
||||
|
||||
;;;; This library is free software; you can redistribute it and/or
|
||||
;;;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -147,8 +147,9 @@ If FILE begins with `-' the -s switch is mandatory.
|
|||
(let ((port (if fatal?
|
||||
(current-error-port)
|
||||
(current-output-port))))
|
||||
(if fmt
|
||||
(apply format port fmt args))
|
||||
(when fmt
|
||||
(apply format port fmt args)
|
||||
(newline port))
|
||||
|
||||
(format port (_ "Usage: ~a [OPTION]... [FILE]...\n") name)
|
||||
(display *usage* port)
|
||||
|
@ -203,7 +204,8 @@ If FILE begins with `-' the -s switch is mandatory.
|
|||
(turn-off-debugging? #f))
|
||||
|
||||
(define (error fmt . args)
|
||||
(apply shell-usage usage-name #t fmt args))
|
||||
(apply shell-usage usage-name #t
|
||||
(string-append "error: " fmt "~%") args))
|
||||
|
||||
(define (parse args out)
|
||||
(cond
|
||||
|
@ -405,7 +407,7 @@ If FILE begins with `-' the -s switch is mandatory.
|
|||
(exit 0))
|
||||
|
||||
(else
|
||||
(error "Unrecognized switch ~a" arg)))))))
|
||||
(error "unrecognized switch ~a" arg)))))))
|
||||
|
||||
(define (finish args out)
|
||||
;; Check to make sure the -ds got a -s.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue