Skip to content
← Back

src/driver/usage.ghul

1
namespace Driver is
2
// The `--help` text. Kept beside the argument loop in `main.ghul`, which is
3
// the authority on what the compiler accepts: a flag added there wants a
4
// line here too.
5
class USAGE is
6
is_requested(arguments: Collections.Iterable[string]) -> bool static is
7
for argument in arguments do
8
if argument =~ "-h" \/ argument =~ "--help" \/ argument =~ "-?" then
9
return true
10
fi
11
od
12
13
return false
14
si
15
16
text: string static =>
17
"usage: ghul-compiler [options] <source.ghul> ...\n"
18
"\n"
19
"Compiles ghūl source files to a .NET assembly. With no -a or --sdk-ref-path,\n"
20
"the .NET reference assemblies are discovered from the installed SDK, so a\n"
21
"source file on its own is a complete command line:\n"
22
"\n"
23
" ghul-compiler hello.ghul\n"
24
"\n"
25
"The output is named after the first source file unless -o says otherwise. A\n"
26
"program that uses the ghūl runtime needs ghul-runtime.dll beside the binary\n"
27
"before it will run; an MSBuild build puts it there for you.\n"
28
"\n"
29
"modes:\n"
30
" -A, --analyse serve language-service requests on stdin/stdout\n"
31
" --compile-server compile one JSON request per line from stdin, replying on stdout\n"
32
" -G, --type-check parse and type-check only, emitting nothing\n"
33
" -g, --no-type-check parse only\n"
34
" --check-complete parse one source and print complete, incomplete or invalid\n"
35
" -S, --assembler generate code but write no assembly\n"
36
" --format reformat the sources to standard output\n"
37
" --format-in-place reformat the source files themselves\n"
38
" --format-width <cols> column the formatter wraps at (default 100)\n"
39
" --library build a library rather than an executable\n"
40
"\n"
41
"output:\n"
42
" -o, --output <path> write the assembly here\n"
43
" --debug emit debug information\n"
44
" --target-framework <tfm> target framework moniker, e.g. net10.0\n"
45
" --version <version> version stamped into the assembly\n"
46
" --resource <path>=<name> embed <path> as a managed resource named <name>; repeatable\n"
47
" --assembly-info-string <attribute>=<value>\n"
48
" apply this attribute to the assembly; a value with a comma\n"
49
" fills a two-string constructor when there is no one-string one\n"
50
"\n"
51
"references:\n"
52
" -a, --assembly <name> reference this assembly; repeatable, and naming any replaces the default set\n"
53
" --reference <name> reference this assembly as well as the reference set; repeatable\n"
54
" --sdk-ref-path <dir> directory holding the .NET reference assemblies\n"
55
" -p, --library-prefix <path> prefix for resolving referenced assemblies\n"
56
" --exclude-runtime-symbols do not load the ghūl runtime's symbols\n"
57
"\n"
58
"compilation:\n"
59
" --default-use <names> what `use default` imports; comma-separated\n"
60
" --define <symbol> define a conditional compilation symbol\n"
61
" --entry <name> name of the entry point function\n"
62
" --global-namespace share one namespace across namespace-less files\n"
63
" --implicit-default-use give each namespace-less file an implicit `use default`\n"
64
" --submission <name> compile one step of an interactive session: the namespace-less file's namespace is <name>, and its entry returns its final expression's value\n"
65
" --underscore-access <m> underscore visibility: private, protected, legacy\n"
66
" -E, --ignore-errors carry on emitting after an error\n"
67
"\n"
68
"diagnostics:\n"
69
" --suppress <slugs> silence these warnings; comma-separated\n"
70
" --warn-as-error <slugs> promote these warnings to errors, or all\n"
71
" --warn-as-info <slugs> demote these warnings to information\n"
72
" --warn-as-hint <slugs> demote these warnings to editor hints\n"
73
" --msbuild-diagnostics report diagnostics in MSBuild's format\n"
74
"\n"
75
"analysis mode:\n"
76
" --incremental-analysis reuse the symbol table across edits\n"
77
" --analysis-idle-timeout <seconds> exit after this long without a request\n"
78
" --show-analysis-stats report timings for each analysis request\n"
79
" --no-analysis-heap-watchdog do not force collection when the heap grows\n"
80
"\n"
81
"other:\n"
82
" -h, -?, --help show this message\n"
83
" @<file> read further arguments from this file\n"
84
"\n"
85
"With no arguments at all the compiler prints its version. There is no flag\n"
86
"for that: --version sets the version of the assembly being built.\n"
87
si
88
si