1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-26 00:10:27 +00:00

Update man page.

This commit is contained in:
Calvin Rose 2019-02-18 15:23:59 -05:00
parent 6af5800d21
commit 732de8f88d

47
janet.1
View File

@ -3,8 +3,11 @@
janet \- run the Janet language abstract machine janet \- run the Janet language abstract machine
.SH SYNOPSIS .SH SYNOPSIS
.B janet .B janet
[\fB\-hvsrp\fR] [\fB\-hvsrpq\fR]
[\fB\-e\fR \fIJANET SOURCE\fR] [\fB\-e\fR \fISOURCE\fR]
[\fB\-l\fR \fIMODULE\fR]
[\fB\-m\fR \fIPATH\fR]
[\fB\-c\fR \fIMODULE JIMAGE\fR]
[\fB\-\-\fR] [\fB\-\-\fR]
.IR script .IR script
.IR args ... .IR args ...
@ -16,7 +19,7 @@ to native code written in C, meta-programming with macros, and bytecode assembly
There is a repl for trying out the language, as well as the ability to run script files. There is a repl for trying out the language, as well as the ability to run script files.
This client program is separate from the core runtime, so Janet could be embedded This client program is separate from the core runtime, so Janet could be embedded
into other programs. Try Janet in your browser at https://Janet-lang.org. into other programs. Try Janet in your browser at https://janet-lang.org.
Implemented in mostly standard C99, Janet runs on Windows, Linux and macOS. Implemented in mostly standard C99, Janet runs on Windows, Linux and macOS.
The few features that are not standard C99 (dynamic library loading, compiler The few features that are not standard C99 (dynamic library loading, compiler
@ -41,8 +44,9 @@ Shows the version text and exits immediately.
Read raw input from stdin and forgo prompt history and other readline-like features. Read raw input from stdin and forgo prompt history and other readline-like features.
.TP .TP
.BR \-q .BR \-e\ code
Quiet output. Don't print a repl prompt or expression results to stdout. Execute a string of Janet source. Source code is executed in the order it is encountered, so earlier
arguments are executed before later ones.
.TP .TP
.BR \-r .BR \-r
@ -56,30 +60,31 @@ it will immediately exit after printing the error message. In persistent mode, J
after an error. Persistent mode can be good for debugging and testing. after an error. Persistent mode can be good for debugging and testing.
.TP .TP
.BR \-e .BR \-q
Execute a string of Janet source. Source code is executed in the order it is encountered, so earlier Quiet output. Don't print a repl prompt or expression results to stdout.
arguments are executed before later ones.
.TP .TP
.BR \-l .BR \-m\ syspath
Set the variable module/*syspath* to the string syspath so that Janet will load system modules
from a directory different than the default. The default is set when Janet is built, and defaults to
/usr/local/lib/janet on Linux/Posix, and C:/Janet/Library on Windows.
.TP
.BR \-c\ source\ output
Precompiles Janet source code into an image, a binary dump that can be efficiently loaded later.
Source should be a path to the Janet module to compile, and output should be the file path of
resulting image. Output should usually end with the .jimage extension.
.TP
.BR \-l\ path
Load a Janet file before running a script or repl. Multiple files can be loaded Load a Janet file before running a script or repl. Multiple files can be loaded
in this manner, and exports from each file will be made available to the script in this manner, and exports from each file will be made available to the script
or repl. or repl.
.TP .TP
.BR \-\- .BR \-\-
Stop parsing command line arguments. All arguments after this one will be considered file names. Stop parsing command line arguments. All arguments after this one will be considered file names
and then arguments to the script.
.SH ENVIRONMENT
.B JANET_PATH
.RS
The location to look for Janet libraries. This is the only environment variable Janet needs to
find native and source code modules. If no JANET_PATH is set, Janet will look in
/usr/local/lib/Janet for modules.
To make Janet search multiple locations, modify the module.paths
array in Janet.
.RE
.SH AUTHOR .SH AUTHOR
Written by Calvin Rose <calsrose@gmail.com> Written by Calvin Rose <calsrose@gmail.com>