Interactive help: Difference between revisions

m
→‎{{header|Wren}}: Version change.
m (Thundergnat moved page Interactive Help to Interactive help: Follow normal task title capitalization policy)
m (→‎{{header|Wren}}: Version change.)
 
(9 intermediate revisions by 7 users not shown)
Line 1:
{{draft task}}
 
 
;Task:
Demonstrate any interactive (or command line) help offered by the language implementation.
 
Line 7 ⟶ 9:
 
=={{header|AWK}}==
<syntaxhighlight lang="awk">
<lang AWK>
# syntax: GAWK --help
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 52 ⟶ 54:
gawk '{ sum += $1 }; END { print sum }' file
gawk -F: '{ print $1 }' /etc/passwd
</pre>
 
=={{header|Common Lisp}}==
Common Lisp supports several interactive features for exploring the language and runtime. The built-in functions [http://www.lispworks.com/documentation/lw71/CLHS/Body/f_docume.htm <code>documentation</code>] and [http://clhs.lisp.se/Body/f_descri.htm#describe <code>describe</code>] will both present information on objects in the system.
{{out}}
<pre>
CL-USER> (describe #'char-code)
#<FUNCTION CHAR-CODE>
[compiled function]
 
 
Lambda-list: (CHAR)
Declared type: (FUNCTION (CHARACTER) (VALUES (MOD 1114112) &OPTIONAL))
Documentation:
Return the integer code of CHAR.
Known attributes: foldable, flushable, unsafely-flushable, movable
Source file: SYS:SRC;CODE;TARGET-CHAR.LISP
; No value
CL-USER> (documentation #'char-code 'function)
"Return the integer code of CHAR."
</pre>
 
Line 89 ⟶ 111:
 
Additionally, by pressing <code>F1</code> in the listener, you can access the help browser, an offline version of [https://docs.factorcode.org/content/article-handbook.html Factor's documentation]. Factor's help browser interfaces with the listener in various ways. For example, pressing <code>ctrl+h</code> while the cursor is over a word will take you to that word's documentation. Running <code>"sequences" about</code> in the listener will take you to the documentation for the <code>sequences</code> vocabulary.
 
=={{header|FreeBASIC}}==
See FB-manual-1.0x.chm for the complete manual, available in [https://sourceforge.net/projects/fbc/files/ sourceforge], or [https://www.freebasic.net/wiki/DocToc online].<br>
 
{{out|When invoked as <code>fbc -help</code>, or <code>fbc --help</code> at the command line}}
<pre>
usage: fbc [options] <input files>
input files:
*.a = static library, *.o = object file, *.bas = source
*.rc = resource script, *.res = compiled resource (win32)
*.xpm = icon resource (*nix/*bsd)
options:
@<file> Read more command line arguments from a file
-a <file> Treat file as .o/.a input file
-arch <type> Set target architecture (default: 486)
-asm att|intel Set asm format (-gen gcc|llvm, x86 or x86_64 only)
-b <file> Treat file as .bas input file
-c Compile only, do not link
-C Preserve temporary .o files
-d <name>[=<val>] Add a global #define
-dll Same as -dylib
-dylib Create a DLL (win32) or shared library (*nix/*BSD)
-e Enable runtime error checking
-ex -e plus RESUME support
-exx -ex plus array bounds/null-pointer checking
-export Export symbols for dynamic linkage
-forcelang <name> Override #lang statements in source code
-fpmode fast|precise Select floating-point math accuracy/speed
-fpu x87|sse Set target FPU
-g Add debug info, enable __FB_DEBUG__, and enable assert()
-gen gas|gcc|llvm Select code generation backend
[-]-help Show this help output
-i <path> Add an include file search path
-include <file> Pre-#include a file for each input .bas
-l <name> Link in a library
-lang <name> Select FB dialect: fb, deprecated, fblite, qb
-lib Create a static library
-m <name> Specify main module (default if not -c: first input .bas)
-map <file> Save linking map to file
-maxerr <n> Only show <n> errors
-mt Use thread-safe FB runtime
-nodeflibs Do not include the default libraries
-noerrline Do not show source context in error messages
-noobjinfo Do not read/write compile-time info from/to .o and .a files
-nostrip Do not strip symbol information from the output file
-o <file> Set .o (or -pp .bas) file name for prev/next input file
-O <value> Optimization level (default: 0)
-p <path> Add a library search path
-pic Generate position-independent code (non-x86 Unix shared libs)
-pp Write out preprocessed input file (.pp.bas) only
-prefix <path> Set the compiler prefix path
-print host|target Display host/target system name
-print fblibdir Display the compiler's lib/ path
-print x Display output binary/library file name (if known)
-profile Enable function profiling
-r Write out .asm/.c/.ll (-gen gas/gcc/llvm) only
-rr Write out the final .asm only
-R Preserve temporary .asm/.c/.ll/.def files
-RR Preserve the final .asm file
-s console|gui Select win32 subsystem
-showincludes Display a tree of file names of #included files
-static Prefer static libraries over dynamic ones when linking
-strip Omit all symbol information from the output file
-t <value> Set .exe stack size in kbytes, default: 1024 (win32/dos)
-target <name> Set cross-compilation target
-title <name> Set XBE display title (xbox)
-v Be verbose
-vec <n> Automatic vectorization level (default: 0)
[-]-version Show compiler version
-w all|pedantic|<n> Set min warning level: all, pedantic or a value
-Wa <a,b,c> Pass options to 'as'
-Wc <a,b,c> Pass options to 'gcc' (-gen gcc) or 'llc' (-gen llvm)
-Wl <a,b,c> Pass options to 'ld'
-x <file> Set output executable/library file name
</pre>
 
 
=={{header|Go}}==
Line 231 ⟶ 329:
=={{header|Julia}}==
When Julia is run without a program file as argument, the REPL (Read-Evaluate-Print Loop) runs. Entering a ? at the prompt brings up help, with help on a specific topic obtained if the topic name is preceded by ? at the prompt.
<langsyntaxhighlight lang="julia">
 
> julia
Line 274 ⟶ 372:
The use of the return keyword is exactly the same as in other languages, but is often optional. A function without
an explicit return statement will return the last expression in the function body.
</syntaxhighlight>
</lang>
 
=={{header|Nim}}==
The Nim compiler provides help. By simply typing <code>nim</code> without any option, we get:
 
<pre>Nim Compiler Version 1.4.8 [Linux: amd64]
Compiled at 2021-05-25
Copyright (c) 2006-2021 by Andreas Rumpf
::
 
nim command [options] [projectfile] [arguments]
 
Command:
compile, c compile project with default code generator (C)
r compile to $nimcache/projname, run with [arguments]
using backend specified by `--backend` (default: c)
doc generate the documentation for inputfile for
backend specified by `--backend` (default: c)
 
Arguments:
arguments are passed to the program being run (if --run option is selected)
 
Options:
-p, --path:PATH add path to search paths
-d, --define:SYMBOL(:VAL)
define a conditional symbol
(Optionally: Define the value for that symbol,
see: "compile time define pragmas")
-u, --undef:SYMBOL undefine a conditional symbol
-f, --forceBuild:on|off force rebuilding of all modules
--stackTrace:on|off turn stack tracing on|off
--lineTrace:on|off turn line tracing on|off
--threads:on|off turn support for multi-threading on|off
-x, --checks:on|off turn all runtime checks on|off
-a, --assertions:on|off turn assertions on|off
--opt:none|speed|size optimize not at all or for speed|size
Note: use -d:release for a release build!
--debugger:native Use native debugger (gdb)
--app:console|gui|lib|staticlib
generate a console app|GUI app|DLL|static library
-r, --run run the compiled program with given arguments
--fullhelp show all command line switches
-h, --help show this help
-v, --version show detailed version information
 
Note, single letter options that take an argument require a colon. E.g. -p:PATH</pre>
 
This is the basic help. We can get full help by typing <code>nim --fullHelp</code>:
 
<pre>Nim Compiler Version 1.4.8 [Linux: amd64]
Compiled at 2021-05-25
Copyright (c) 2006-2021 by Andreas Rumpf
::
 
nim command [options] [projectfile] [arguments]
 
Command:
compile, c compile project with default code generator (C)
r compile to $nimcache/projname, run with [arguments]
using backend specified by `--backend` (default: c)
doc generate the documentation for inputfile for
backend specified by `--backend` (default: c)
 
Arguments:
arguments are passed to the program being run (if --run option is selected)
 
Options:
-p, --path:PATH add path to search paths
-d, --define:SYMBOL(:VAL)
define a conditional symbol
(Optionally: Define the value for that symbol,
see: "compile time define pragmas")
-u, --undef:SYMBOL undefine a conditional symbol
-f, --forceBuild:on|off force rebuilding of all modules
--stackTrace:on|off turn stack tracing on|off
--lineTrace:on|off turn line tracing on|off
--threads:on|off turn support for multi-threading on|off
-x, --checks:on|off turn all runtime checks on|off
-a, --assertions:on|off turn assertions on|off
--opt:none|speed|size optimize not at all or for speed|size
Note: use -d:release for a release build!
--debugger:native Use native debugger (gdb)
--app:console|gui|lib|staticlib
generate a console app|GUI app|DLL|static library
-r, --run run the compiled program with given arguments
--fullhelp show all command line switches
-h, --help show this help
-v, --version show detailed version information
 
Note, single letter options that take an argument require a colon. E.g. -p:PATH.
Advanced commands:
compileToC, cc compile project with C code generator
compileToCpp, cpp compile project to C++ code
compileToOC, objc compile project to Objective C code
js compile project to Javascript
e run a Nimscript file
rst2html convert a reStructuredText file to HTML
use `--docCmd:skip` to skip compiling snippets
rst2tex convert a reStructuredText file to TeX
jsondoc extract the documentation to a json file
ctags create a tags file
buildIndex build an index for the whole documentation
genDepend generate a DOT file containing the
module dependency graph
dump dump all defined conditionals and search paths
see also: --dump.format:json (useful with: `| jq`)
check checks the project for syntax and semantic
 
Runtime checks (see -x):
--objChecks:on|off turn obj conversion checks on|off
--fieldChecks:on|off turn case variant field checks on|off
--rangeChecks:on|off turn range checks on|off
--boundChecks:on|off turn bound checks on|off
--overflowChecks:on|off turn int over-/underflow checks on|off
--floatChecks:on|off turn all floating point (NaN/Inf) checks on|off
--nanChecks:on|off turn NaN checks on|off
--infChecks:on|off turn Inf checks on|off
--refChecks:on|off turn ref checks on|off (only for --newruntime)
 
Advanced options:
-o:FILE, --out:FILE set the output filename
--outdir:DIR set the path where the output file will be written
--usenimcache will use `outdir=$nimcache`, whichever it resolves
to after all options have been processed
--stdout:on|off output to stdout
--colors:on|off turn compiler messages coloring on|off
--listFullPaths:on|off list full paths in messages
-w:on|off|list, --warnings:on|off|list
turn all warnings on|off or list all available
--warning[X]:on|off turn specific warning X on|off
--hints:on|off|list turn all hints on|off or list all available
--hint[X]:on|off turn specific hint X on|off
--warningAsError[X]:on|off
turn specific warning X into an error on|off
--styleCheck:off|hint|error
produce hints or errors for Nim identifiers that
do not adhere to Nim's official style guide
https://nim-lang.org/docs/nep1.html
--styleCheck:usages only enforce consistent spellings of identifiers,
do not enforce the style on declarations
--showAllMismatches:on|off
show all mismatching candidates in overloading
resolution
--lib:PATH set the system library path
--import:PATH add an automatically imported module
--include:PATH add an automatically included module
--nimcache:PATH set the path used for generated files
see also https://nim-lang.org/docs/nimc.html#compiler-usage-generated-c-code-directory
-c, --compileOnly:on|off compile Nim files only; do not assemble or link
--noLinking:on|off compile Nim and generated files but do not link
--noMain:on|off do not generate a main procedure
--genScript:on|off generate a compile script (in the 'nimcache'
subdirectory named 'compile_$project$scriptext'),
implies --compileOnly
--genDeps:on|off generate a '.deps' file containing the dependencies
--os:SYMBOL set the target operating system (cross-compilation)
--cpu:SYMBOL set the target processor (cross-compilation)
--debuginfo:on|off enables debug information
-t, --passC:OPTION pass an option to the C compiler
-l, --passL:OPTION pass an option to the linker
--cc:SYMBOL specify the C compiler
--cincludes:DIR modify the C compiler header search path
--clibdir:DIR modify the linker library search path
--clib:LIBNAME link an additional C library
(you should omit platform-specific extensions)
--project document the whole project (doc)
--docRoot:path `nim doc --docRoot:/foo --project --outdir:docs /foo/sub/main.nim`
generates: docs/sub/main.html
if path == @pkg, will use nimble file enclosing dir
if path == @path, will use first matching dir in `--path`
if path == @default (the default and most useful), will use
best match among @pkg,@path.
if these are nonexistent, will use project path
-b, --backend:c|cpp|js|objc sets backend to use with commands like `nim doc` or `nim r`
--docCmd:cmd if `cmd == skip`, skips runnableExamples
else, runs runnableExamples with given options, e.g.:
`--docCmd:"-d:foo --threads:on"`
--docSeeSrcUrl:url activate 'see source' for doc command
(see doc.item.seesrc in config/nimdoc.cfg)
--docInternal also generate documentation for non-exported symbols
--lineDir:on|off generation of #line directive on|off
--embedsrc:on|off embeds the original source code as comments
in the generated output
--threadanalysis:on|off turn thread analysis on|off
--tlsEmulation:on|off turn thread local storage emulation on|off
--taintMode:on|off turn taint mode on|off
--implicitStatic:on|off turn implicit compile time evaluation on|off
--trmacros:on|off turn term rewriting macros on|off
--multimethods:on|off turn multi-methods on|off
--memTracker:on|off turn memory tracker on|off
--hotCodeReloading:on|off
turn support for hot code reloading on|off
--excessiveStackTrace:on|off
stack traces use full file paths
--stackTraceMsgs:on|off enable user defined stack frame msgs via `setFrameMsg`
--nilseqs:on|off allow 'nil' for strings/seqs for
backwards compatibility
--seqsv2:on|off use the new string/seq implementation based on
destructors
--skipCfg:on|off do not read the nim installation's configuration file
--skipUserCfg:on|off do not read the user's configuration file
--skipParentCfg:on|off do not read the parent dirs' configuration files
--skipProjCfg:on|off do not read the project's configuration file
--gc:refc|arc|orc|markAndSweep|boehm|go|none|regions
select the GC to use; default is 'refc'
--exceptions:setjmp|cpp|goto
select the exception handling implementation
--index:on|off turn index file generation on|off
--putenv:key=value set an environment variable
--NimblePath:PATH add a path for Nimble support
--noNimblePath deactivate the Nimble path
--clearNimblePath empty the list of Nimble package search paths
--cppCompileToNamespace:namespace
use the provided namespace for the generated C++ code,
if no namespace is provided "Nim" will be used
--expandMacro:MACRO dump every generated AST from MACRO
--expandArc:PROCNAME show how PROCNAME looks like after diverse optimizations
before the final backend phase (mostly ARC/ORC specific)
--excludePath:PATH exclude a path from the list of search paths
--dynlibOverride:SYMBOL marks SYMBOL so that dynlib:SYMBOL
has no effect and can be statically linked instead;
symbol matching is fuzzy so
that --dynlibOverride:lua matches
dynlib: "liblua.so.3"
--dynlibOverrideAll
disables the effects of the dynlib pragma
--listCmd list the compilation commands; can be combined with
`--hint:exec:on` and `--hint:link:on`
--asm produce assembler code
--parallelBuild:0|1|... perform a parallel build
value = number of processors (0 for auto-detect)
--incremental:on|off only recompile the changed modules (experimental!)
--verbosity:0|1|2|3 set Nim's verbosity level (1 is default)
--errorMax:N stop compilation after N errors; 0 means unlimited
--maxLoopIterationsVM:N set max iterations for all VM loops
--experimental:implicitDeref|dotOperators|callOperator|parallel|destructor|notnil|dynamicBindSym|forLoopMacros|caseStmtMacros|codeReordering|compiletimeFFI|vmopsDanger|strictFuncs|views
enable experimental language feature
--legacy:allowSemcheckedAstModification|checkUnsignedConversions
enable obsolete/legacy language feature
--useVersion:1.0 emulate Nim version X of the Nim compiler
--profiler:on|off enable profiling; requires `import nimprof`, and
works better with `--stackTrace:on`
see also https://nim-lang.github.io/Nim/estp.html
--benchmarkVM:on|off enable benchmarking of VM code with cpuTime()
--profileVM:on|off enable compile time VM profiler
--sinkInference:on|off en-/disable sink parameter inference (default: on)
--panics:on|off turn panics into process terminations (default: off)
--deepcopy:on|off enable 'system.deepCopy' for ``--gc:arc|orc``</pre>
 
The <code>nimble</code> program used to install modules has it own help. Type <code>nimble</code> without any option:
 
<pre>Usage: nimble [nimbleopts] COMMAND [cmdopts]
 
Commands:
install [pkgname, ...] Installs a list of packages.
[-d, --depsOnly] Installs only dependencies of the package.
[opts, ...] Passes options to the Nim compiler.
develop [pkgname, ...] Clones a list of packages for development.
Symlinks the cloned packages or any package
in the current working directory.
check Verifies the validity of a package in the
current working directory.
init [pkgname] Initializes a new Nimble project in the
current directory or if a name is provided a
new directory of the same name.
[--git, --hg] Creates a git/hg repo in the new nimble project.
publish Publishes a package on nim-lang/packages.
The current working directory needs to be the
toplevel directory of the Nimble package.
uninstall [pkgname, ...] Uninstalls a list of packages.
[-i, --inclDeps] Uninstalls package and dependent package(s).
build [opts, ...] [bin] Builds a package. Passes options to the Nim
compiler.
run [opts, ...] [bin] Builds and runs a package.
Binary needs to be specified after any
compilation options if there are several
binaries defined. Any flags after the binary
or -- arg are passed to the binary when it is run.
c, cc, js [opts, ...] f.nim Builds a file inside a package. Passes options
to the Nim compiler.
test Compiles and executes tests.
[-c, --continue] Don't stop execution on a failed test.
[opts, ...] Passes options to the Nim compiler.
doc, doc2 [opts, ...] f.nim Builds documentation for a file inside a
package. Passes options to the Nim compiler.
refresh [url] Refreshes the package list. A package list URL
can be optionally specified.
search pkg/tag Searches for a specified package. Search is
performed by tag and by name.
[--ver] Queries remote server for package version.
list Lists all packages.
[--ver] Queries remote server for package version.
[-i, --installed] Lists all installed packages.
tasks Lists the tasks specified in the Nimble
package's Nimble file.
path pkgname ... Shows absolute path to the installed packages
specified.
dump [pkgname] Outputs Nimble package information for
external tools. The argument can be a
.nimble file, a project directory or
the name of an installed package.
[--ini, --json] Selects the output format (the default is --ini).
 
Nimble Options:
-h, --help Print this help message.
-v, --version Print version information.
-y, --accept Accept all interactive prompts.
-n, --reject Reject all interactive prompts.
-l, --localdeps Run in project local dependency mode
--ver Query remote server for package version
information when searching or listing packages.
--nimbleDir:dirname Set the Nimble directory.
--nim:path Use specified path for Nim compiler
--silent Hide all Nimble and Nim output
--verbose Show all non-debug output.
--debug Show all output including debug messages.
--noColor Don't colorise output.
--noSSLCheck Don't check SSL certificates.
 
For more information read the Github readme:
https://github.com/nim-lang/nimble#readme</pre>
 
And, last but not least, Nim provides <code>nimsuggest</code> which can be integrated in an IDE to provide completion and help when typing a program. The best integration is probably the one done for VSCode which is certainly the most used IDE for programming in Nim.
 
=={{header|Perl}}==
Line 393 ⟶ 813:
See docs\phix\phix.chm for the complete manual, or [http://phix.x10.mx/docs/html/phix.htm online].<br>
When p -?, p -h, p -help, or p --help is entered:
<!--(notonline)-->
<pre>
interpret: <filename>
Line 411 ⟶ 832:
Phix hybrid interpreter/compiler.
 
Version 1.0.8.02 (32 bit Windows) Copyright Pete Lomax 2006..20162022
 
Enter ? for options or filename to execute:
Line 432 ⟶ 853:
Individual Raku scripts are to some extent self-documenting. If the script has a MAIN sub, and it is called with improper parameters, it will display an automatically generated help message showing the various possible parameters, which are required, which are optional, and what type each takes:
 
<syntaxhighlight lang="raku" perl6line>sub MAIN(
Str $run, #= Task or file name
Str :$lang = 'raku', #= Language, default raku
Line 439 ⟶ 860:
) {
# do whatever
}</langsyntaxhighlight>
 
{{out|When saved locally as main.raku and invoked with no (or wrong) passed parameters}}
Line 456 ⟶ 877:
Other REXXes have an HTML document or a PDF for showing command syntax and other general information on use of the language.
 
Each REXX has it's own documentation, and viewing it would depend on the host environment and the particular version of REXX.
<br><br>
 
Line 555 ⟶ 976:
 
See 'cargo help <command>' for more information on a specific command.
</pre>
 
=={{header|Wren}}==
Interactive help for Wren-cli is currently minimal, just usage and version, viz:
{{out}}
<pre>
$ wren_cli --help
Usage: wren [file] [arguments...]
 
Optional arguments:
--help Show command line usage
--version Show version
 
$ wren_cli --version
wren 0.4.0
</pre>
 
=={{header|Yabasic}}==
 
See yabasic.htm for the complete manual, or [https://2484.de/yabasic/yabasic.htm online].<br>
 
{{out|When invoked as <code>yabasic -help</code>, <code>yabasic -h</code>, or <code>yabasic -?</code> at the command line}}
<pre>
Usage: yabasic [OPTIONS] [FILENAME [ARGUMENTS]]
 
FILENAME : file, which contains the yabasic program; omit it to type
in your program on the fly (terminated by a double newline)
ARGUMENTS : strings, that are available from within the yabasic program
 
Available OPTIONS:
--help : print this message
--version : show version of yabasic
-i,--infolevel [dnwefb] : set infolevel to debug,note,warning,error,fatal or bison+flex
-e,--execute COMMANDS : execute yabasic COMMANDS right away
--bind BOUND : bind interpreter with FILENAME into BOUND
--geometry x+y : position graphic window at x,y
--font FONT : font for graphic, supply style (decorative,dontcare,
modern,roman,script or swiss) and size, e.g. swiss10
--docu NAME : print embedded docu of program or library
--check : check for possible compatibility problems
--librarypath PATH : directory to search libraries not found in
current dir (default d:\program files\yabasic\lib\)
-- : pass any subsequent words as arguments to yabasic
 
---Program done, press RETURN---
</pre>
9,476

edits