prettify --help output and add it to Readme.org
This commit is contained in:
16
Readme.org
16
Readme.org
@@ -20,7 +20,21 @@ https://wiki.call-cc.org/man/5/Extension%20tools#changing-the-repository-locatio
|
|||||||
~make~
|
~make~
|
||||||
|
|
||||||
* Usage
|
* Usage
|
||||||
You'll also need a C compiler, so pick any.
|
** Summary
|
||||||
|
#+begin_src
|
||||||
|
Usage: sexc [options] filename [-- options-for-c-compiler]
|
||||||
|
Options:
|
||||||
|
--c-compiler=ARG Select C compiler. Defaults to value of SEX_CC
|
||||||
|
environment variable, or if it is empty, to cc
|
||||||
|
-c, --compile-object Compile object file instead of executable program
|
||||||
|
-E, --preprocess Emit C code
|
||||||
|
--public-interface Get module's public interface
|
||||||
|
-h, --help Show this help
|
||||||
|
-m, --macro-expand Emit macro-expanded Sex code
|
||||||
|
-o, --output=ARG Write output to file. Default file name is a.out.
|
||||||
|
If -E or -m options are provided, defaults to stdout
|
||||||
|
#+end_src
|
||||||
|
** Compiling Hello World
|
||||||
#+begin_src
|
#+begin_src
|
||||||
sexc ./examples/hell-world.sex -o hello
|
sexc ./examples/hell-world.sex -o hello
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|||||||
47
sexc.scm
47
sexc.scm
@@ -278,32 +278,35 @@
|
|||||||
;;; Main function facilities
|
;;; Main function facilities
|
||||||
|
|
||||||
(define opts-grammar
|
(define opts-grammar
|
||||||
`((c-compiler "Select C compiler. Defaults to value of SEX_CC environment variable, or if it is empty, to cc"
|
(let ((padding 26))
|
||||||
(required #f)
|
`((c-compiler ,(fmt #f "Select C compiler. Defaults to value of SEX_CC" nl
|
||||||
(value #t))
|
(pad padding) "environment variable, or if it is empty, to cc")
|
||||||
(compile-object "Compile object file instead of executable program"
|
(required #f)
|
||||||
(required #f)
|
(value #t))
|
||||||
(value #f)
|
(compile-object "Compile object file instead of executable program"
|
||||||
(single-char #\c))
|
|
||||||
(preprocess "Emit C code"
|
|
||||||
(required #f)
|
|
||||||
(value #f)
|
|
||||||
(single-char #\E))
|
|
||||||
(public-interface "Get module's public interface"
|
|
||||||
(required #f)
|
(required #f)
|
||||||
(value #f))
|
(value #f)
|
||||||
(help "Show this help"
|
(single-char #\c))
|
||||||
(required #f)
|
(preprocess "Emit C code"
|
||||||
(value #f)
|
|
||||||
(single-char #\h))
|
|
||||||
(macro-expand "Emit macro-expanded Sex code"
|
|
||||||
(required #f)
|
(required #f)
|
||||||
(value #f)
|
(value #f)
|
||||||
(single-char #\m))
|
(single-char #\E))
|
||||||
(output "Write output to file. Default file name is a.out. If -E or -m options are provided, defaults to stdout"
|
(public-interface "Get module's public interface"
|
||||||
|
(required #f)
|
||||||
|
(value #f))
|
||||||
|
(help "Show this help"
|
||||||
(required #f)
|
(required #f)
|
||||||
(value #t)
|
(value #f)
|
||||||
(single-char #\o))))
|
(single-char #\h))
|
||||||
|
(macro-expand "Emit macro-expanded Sex code"
|
||||||
|
(required #f)
|
||||||
|
(value #f)
|
||||||
|
(single-char #\m))
|
||||||
|
(output ,(fmt #f "Write output to file. Default file name is a.out." nl
|
||||||
|
(pad padding) "If -E or -m options are provided, defaults to stdout")
|
||||||
|
(required #f)
|
||||||
|
(value #t)
|
||||||
|
(single-char #\o)))))
|
||||||
|
|
||||||
(define (print-help)
|
(define (print-help)
|
||||||
(fmt #t "Usage: sexc [options] filename [-- options-for-c-compiler]\n")
|
(fmt #t "Usage: sexc [options] filename [-- options-for-c-compiler]\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user