build: Update script help and usage.
* doc/mes.texi (Invoking mesar): New section. * mes/module/mes/boot-0.scm: Add one line help description. * module/mescc.scm (parse-opts): Likewise. * scripts/diff.scm (main): Add -h,--help, -v,--version. * scripts/mesar.in: Likewise.
This commit is contained in:
parent
6a5619de9a
commit
c6cceb47f3
33
doc/mes.texi
33
doc/mes.texi
|
@ -85,6 +85,7 @@ Bootstrapping
|
||||||
* The Mes Bootstrap Process:: How Mes will make you yogurt from pure milk.
|
* The Mes Bootstrap Process:: How Mes will make you yogurt from pure milk.
|
||||||
* Invoking Mes:: Running Mes, a minimalist Guile lookalike.
|
* Invoking Mes:: Running Mes, a minimalist Guile lookalike.
|
||||||
* Invoking MesCC:: Running the MesCC bootstrap compiler.
|
* Invoking MesCC:: Running the MesCC bootstrap compiler.
|
||||||
|
* Invoking mesar::
|
||||||
|
|
||||||
Invoking Mes
|
Invoking Mes
|
||||||
|
|
||||||
|
@ -98,6 +99,7 @@ Contributing
|
||||||
|
|
||||||
* Building from Git:: The latest and greatest.
|
* Building from Git:: The latest and greatest.
|
||||||
* Running Mes From the Source Tree:: Hacker tricks.
|
* Running Mes From the Source Tree:: Hacker tricks.
|
||||||
|
* Porting GNU Mes:: Teach Mes about your platform.
|
||||||
* The Perfect Setup:: The right tools.
|
* The Perfect Setup:: The right tools.
|
||||||
* Coding Style:: Hygiene of the contributor.
|
* Coding Style:: Hygiene of the contributor.
|
||||||
* Submitting Patches:: Share your work.
|
* Submitting Patches:: Share your work.
|
||||||
|
@ -585,6 +587,7 @@ responsibility.
|
||||||
* The Mes Bootstrap Process:: How Mes will make you yogurt from pure milk.
|
* The Mes Bootstrap Process:: How Mes will make you yogurt from pure milk.
|
||||||
* Invoking Mes:: Running Mes, a minimalist Guile lookalike.
|
* Invoking Mes:: Running Mes, a minimalist Guile lookalike.
|
||||||
* Invoking MesCC:: Running the MesCC bootstrap compiler.
|
* Invoking MesCC:: Running the MesCC bootstrap compiler.
|
||||||
|
* Invoking mesar::
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@node The Mes Bootstrap Process
|
@node The Mes Bootstrap Process
|
||||||
|
@ -874,7 +877,7 @@ preprocess and compile only; do not assemble or link
|
||||||
@item --std=STANDARD
|
@item --std=STANDARD
|
||||||
assume that the input sources are for STANDARD
|
assume that the input sources are for STANDARD
|
||||||
|
|
||||||
@item -v, --version
|
@item -V,--version
|
||||||
display version and exit
|
display version and exit
|
||||||
|
|
||||||
@item -w,--write=TYPE
|
@item -w,--write=TYPE
|
||||||
|
@ -918,6 +921,34 @@ during the parsing phase.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
|
@node Invoking mesar
|
||||||
|
@section Invoking mesar
|
||||||
|
|
||||||
|
@example
|
||||||
|
mesar @var{option}@dots{} @var{command} @file{ARCHIVE-FILE} @file{FILE}@dots{}
|
||||||
|
@end example
|
||||||
|
|
||||||
|
The @var{command} is ignored for compatibility with @file{ar}
|
||||||
|
|
||||||
|
@example
|
||||||
|
r[ab][f][u] - replace existing or insert new file(s) into the archive
|
||||||
|
[c] - do not warn if the library had to be created
|
||||||
|
[D] - use zero for timestamps and uids/gids (default)
|
||||||
|
@end example
|
||||||
|
|
||||||
|
and assumed to be @var{crD}.
|
||||||
|
|
||||||
|
The @var{option}s can be among the following:
|
||||||
|
|
||||||
|
@table @code
|
||||||
|
|
||||||
|
@item -h, --help
|
||||||
|
display this help and exit
|
||||||
|
|
||||||
|
@item -V,--version
|
||||||
|
display version and exit
|
||||||
|
|
||||||
|
@end table
|
||||||
|
|
||||||
@c *********************************************************************
|
@c *********************************************************************
|
||||||
@node Contributing
|
@node Contributing
|
||||||
|
|
|
@ -213,6 +213,7 @@
|
||||||
(load-path (single-char #\L) (value #t))
|
(load-path (single-char #\L) (value #t))
|
||||||
(main (single-char #\e) (value #t))
|
(main (single-char #\e) (value #t))
|
||||||
(source (single-char #\s) (value #t))
|
(source (single-char #\s) (value #t))
|
||||||
|
(version (single-char #\v))
|
||||||
(version (single-char #\V)))))
|
(version (single-char #\V)))))
|
||||||
(getopt-long args option-spec #:stop-at-first-non-option #t)))
|
(getopt-long args option-spec #:stop-at-first-non-option #t)))
|
||||||
(define (source-arg? o)
|
(define (source-arg? o)
|
||||||
|
@ -234,8 +235,9 @@
|
||||||
(exit 0))
|
(exit 0))
|
||||||
(and (or help? usage?)
|
(and (or help? usage?)
|
||||||
(display "Usage: mes [OPTION]... [FILE]...
|
(display "Usage: mes [OPTION]... [FILE]...
|
||||||
Evaluate code with Mes, interactively or from a script.
|
Scheme interpreter for bootstrapping the GNU system.
|
||||||
|
|
||||||
|
Options:
|
||||||
[-s] FILE load source code from FILE, and exit
|
[-s] FILE load source code from FILE, and exit
|
||||||
-c EXPR evalute expression EXPR, and exit
|
-c EXPR evalute expression EXPR, and exit
|
||||||
-- stop scanning arguments; run interactively
|
-- stop scanning arguments; run interactively
|
||||||
|
|
|
@ -92,6 +92,9 @@
|
||||||
(and (or help? usage?)
|
(and (or help? usage?)
|
||||||
(format (or (and usage? (current-error-port)) (current-output-port)) "\
|
(format (or (and usage? (current-error-port)) (current-output-port)) "\
|
||||||
Usage: mescc [OPTION]... FILE...
|
Usage: mescc [OPTION]... FILE...
|
||||||
|
C99 compiler in Scheme for bootstrapping the GNU system.
|
||||||
|
|
||||||
|
Options:
|
||||||
--align align globals
|
--align align globals
|
||||||
--arch=ARCH compile for ARCH [~a]
|
--arch=ARCH compile for ARCH [~a]
|
||||||
-dumpmachine display the compiler's target machine
|
-dumpmachine display the compiler's target machine
|
||||||
|
@ -112,7 +115,7 @@ Usage: mescc [OPTION]... FILE...
|
||||||
-O LEVEL use optimizing LEVEL
|
-O LEVEL use optimizing LEVEL
|
||||||
-S preprocess and compile only; do not assemble or link
|
-S preprocess and compile only; do not assemble or link
|
||||||
--std=STANDARD assume that the input sources are for STANDARD
|
--std=STANDARD assume that the input sources are for STANDARD
|
||||||
-v, --version display version and exit
|
-V,--version display version and exit
|
||||||
-w,--write=TYPE dump Nyacc AST using TYPE {pretty-print,write}
|
-w,--write=TYPE dump Nyacc AST using TYPE {pretty-print,write}
|
||||||
-x LANGUAGE specify LANGUAGE of the following input files
|
-x LANGUAGE specify LANGUAGE of the following input files
|
||||||
|
|
||||||
|
|
|
@ -113,10 +113,28 @@ exec ${MES-mes} -L ${0%/*} -e '(diff)' -s "$0" "$@"
|
||||||
(cdr a-lines) (cdr b-lines))))))))))
|
(cdr a-lines) (cdr b-lines))))))))))
|
||||||
|
|
||||||
(define (main args)
|
(define (main args)
|
||||||
(let* ((files (cdr args))
|
(let ((files (cdr args)))
|
||||||
(files (if (string-prefix? "-" (car files)) (cdr files) files))
|
(when (or (null? files)
|
||||||
|
(equal? (car files) "-h")
|
||||||
|
(equal? (car files) "--help"))
|
||||||
|
(display "
|
||||||
|
Usage: diff.scm [OPTION]... FILES
|
||||||
|
Compare FILES line by line.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-u,--unified display unified diff (default)
|
||||||
|
-h,--help display this help and exit
|
||||||
|
-V,--version display version information and exit
|
||||||
|
")
|
||||||
|
(exit (if (null? files) 2 0)))
|
||||||
|
(when (or (equal? (car files) "-V")
|
||||||
|
(equal? (car files) "--version"))
|
||||||
|
(display "
|
||||||
|
diff.scm (GNU Mes) 0.20
|
||||||
|
"))
|
||||||
|
(let* ((files (if (string-prefix? "-" (car files)) (cdr files) files))
|
||||||
(hunks (apply diff-files (list-head files 2))))
|
(hunks (apply diff-files (list-head files 2))))
|
||||||
(when (pair? hunks)
|
(when (pair? hunks)
|
||||||
(display (string-join (append-map hunk->lines hunks) "\n"))
|
(display (string-join (append-map hunk->lines hunks) "\n"))
|
||||||
(newline)
|
(newline)
|
||||||
(exit 1))))
|
(exit 1)))))
|
||||||
|
|
|
@ -22,10 +22,56 @@ if [ "$V" = 2 ]; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# parse arguments
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case $1 in
|
||||||
|
(-h|--help)
|
||||||
|
cat <<EOF
|
||||||
|
Usage: mesar [OPTION]... COMMAND ARCHIVE-FILE FILE...
|
||||||
|
Archiver for MesCC.
|
||||||
|
|
||||||
|
Commands:
|
||||||
|
r[ab][f][u] - replace existing or insert new file(s) into the archive
|
||||||
|
[c] - do not warn if the library had to be created
|
||||||
|
[D] - use zero for timestamps and uids/gids (default)
|
||||||
|
|
||||||
|
are ignored and assumed to be "crD".
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h,--help display this help and exit
|
||||||
|
-V,--version display version information and exit
|
||||||
|
EOF
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
(-V|--version)
|
||||||
|
cat <<EOF
|
||||||
|
mesar (GNU Mes) @VERSION@
|
||||||
|
EOF
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
-*) shift
|
||||||
|
;;
|
||||||
|
*) break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
command=$1
|
command=$1
|
||||||
archive=$2
|
|
||||||
shift
|
shift
|
||||||
|
if [ -z "$command" ]; then
|
||||||
|
echo "AR: Usage error: missing command." 1>&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
archive=$1
|
||||||
shift
|
shift
|
||||||
|
if [ -z "$archive" ]; then
|
||||||
|
echo "AR: Usage error: missing archive" 1>&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
echo "AR: Usage error: missing object files" 1>&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
M1_archive=$(dirname "$archive")/$(basename "$archive" .a).s
|
M1_archive=$(dirname "$archive")/$(basename "$archive" .a).s
|
||||||
for o in "$@"; do
|
for o in "$@"; do
|
||||||
s=$(dirname "$o")/$(basename "$o" .o).s
|
s=$(dirname "$o")/$(basename "$o" .o).s
|
||||||
|
|
Loading…
Reference in a new issue