Interactive help: Difference between revisions

m
→‎{{header|Wren}}: Version change.
m (→‎{{header|Wren}}: Version change.)
 
(7 intermediate revisions by 5 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}}==
Line 715 ⟶ 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 733 ⟶ 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 754 ⟶ 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 761 ⟶ 860:
) {
# do whatever
}</langsyntaxhighlight>
 
{{out|When saved locally as main.raku and invoked with no (or wrong) passed parameters}}
Line 778 ⟶ 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 891 ⟶ 990:
 
$ wren_cli --version
wren 0.34.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,488

edits