mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-03 08:10:31 +02:00
* guile-config.in: Redo the help system, so that each subcommand
defines its own usage text, as well as its help text.
This commit is contained in:
parent
c3d20aa6a2
commit
204c26b986
1 changed files with 44 additions and 38 deletions
|
@ -48,18 +48,28 @@
|
||||||
(show-help-overview))))
|
(show-help-overview))))
|
||||||
|
|
||||||
(define (show-help-overview)
|
(define (show-help-overview)
|
||||||
(let ((dl display-line-error))
|
(display-line-error "Usage: ")
|
||||||
(dl "Usage: ")
|
(for-each (lambda (row) ((cadddr row)))
|
||||||
(dl " " program-name " link - print libraries to link with")
|
command-table))
|
||||||
;; Not yet implemented.
|
|
||||||
;; (dl " " program-name " main - generate initialization code")
|
(define (usage-help)
|
||||||
(dl " " program-name " info [VAR] - print Guile build directories")
|
(let ((dle display-line-error)
|
||||||
(dl " " program-name " --help - show usage info (this message)")
|
(p program-name))
|
||||||
(dl " " program-name " --help SUBCOMMAND - show help for SUBCOMMAND")
|
(dle " " p " --help - show usage info (this message)")
|
||||||
(dl " " program-name " --version - show running version")))
|
(dle " " p " --help SUBCOMMAND - show help for SUBCOMMAND")))
|
||||||
|
|
||||||
(define (show-version args)
|
(define (show-version args)
|
||||||
(display-line program-name " - Guile version " program-version))
|
(display-line-error program-name " - Guile version " program-version))
|
||||||
|
|
||||||
|
(define (help-version)
|
||||||
|
(let ((dle display-line-error))
|
||||||
|
(dle "Usage: " program-name " --version")
|
||||||
|
(dle "Show the version of this script. This is also the version of")
|
||||||
|
(dle "Guile this script was installed with.")))
|
||||||
|
|
||||||
|
(define (usage-version)
|
||||||
|
(display-line-error
|
||||||
|
" " program-name " --version - show installed script and Guile version"))
|
||||||
|
|
||||||
|
|
||||||
;;;; the "link" subcommand
|
;;;; the "link" subcommand
|
||||||
|
@ -123,25 +133,20 @@
|
||||||
(let ((dle display-line-error))
|
(let ((dle display-line-error))
|
||||||
(dle "Usage: " program-name " link")
|
(dle "Usage: " program-name " link")
|
||||||
(dle "Print linker flags for building the `guile' executable.")
|
(dle "Print linker flags for building the `guile' executable.")
|
||||||
(dle "Print the linker command-line flags necessary to link against the")
|
(dle "Print the linker command-line flags necessary to link against")
|
||||||
(dle "Guile library, and any other libraries it requires.")))
|
(dle "the Guile library, and any other libraries it requires.")))
|
||||||
|
|
||||||
|
(define (usage-link)
|
||||||
|
(display-line-error
|
||||||
|
" " program-name " link - print libraries to link with"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;;; The "main" subcommand
|
;;;; The "compile" subcommand
|
||||||
|
|
||||||
;;; We haven't implemented this yet, because we don't have the
|
(define (build-compile) #f)
|
||||||
;;; mechanisms in place to discover the installed static link
|
(define (help-compile) #f)
|
||||||
;;; libraries. When we do implement this, remember to fix the message
|
(define (usage-compile) #f)
|
||||||
;;; in show-help-overview.
|
|
||||||
(define (build-main args)
|
|
||||||
(display-line-error program-name ": `main' subcommand not yet implemented")
|
|
||||||
(quit 2))
|
|
||||||
|
|
||||||
(define (help-main)
|
|
||||||
(let ((dle display-line-error))
|
|
||||||
(dle "Usage: " program-name " main")
|
|
||||||
(dle "This subcommand is not yet implemented.")))
|
|
||||||
|
|
||||||
|
|
||||||
;;;; The "info" subcommand
|
;;;; The "info" subcommand
|
||||||
|
@ -163,13 +168,16 @@
|
||||||
(newline))
|
(newline))
|
||||||
|
|
||||||
(define (help-info)
|
(define (help-info)
|
||||||
(let ((dle display-line-error))
|
(let ((d display-line-error))
|
||||||
(dle "Usage: " program-name " info [VAR]")
|
(d "Usage: " program-name " info [VAR]")
|
||||||
(dle "Display the value of the Makefile variable VAR used when Guile")
|
(d "Display the value of the Makefile variable VAR used when Guile")
|
||||||
(dle "was built. If VAR is omitted, display all Makefile variables.")
|
(d "was built. If VAR is omitted, display all Makefile variables.")
|
||||||
(dle "Use this command to find out where Guile was installed,")
|
(d "Use this command to find out where Guile was installed,")
|
||||||
(dle "where it will look for Scheme code at run-time, and so on.")))
|
(d "where it will look for Scheme code at run-time, and so on.")))
|
||||||
|
|
||||||
|
(define (usage-info)
|
||||||
|
(display-line-error
|
||||||
|
" " program-name " info [VAR] - print Guile build directories"))
|
||||||
|
|
||||||
|
|
||||||
;;;; trivial utilities
|
;;;; trivial utilities
|
||||||
|
@ -209,13 +217,11 @@
|
||||||
;;; functions have been defined.
|
;;; functions have been defined.
|
||||||
(define command-table
|
(define command-table
|
||||||
(list
|
(list
|
||||||
(list "--version" show-version show-help-overview)
|
(list "--version" show-version help-version usage-version)
|
||||||
(list "--help" show-help show-help-overview)
|
(list "--help" show-help show-help-overview usage-help)
|
||||||
(list "link" build-link help-link)
|
(list "link" build-link help-link usage-link)
|
||||||
(list "main" build-main help-main)
|
(list "compile" build-compile help-compile usage-compile)
|
||||||
(list "info" build-info help-info)))
|
(list "info" build-info help-info usage-info)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Local Variables:
|
;;; Local Variables:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue