@@ -14,22 +14,37 @@ public override int Execute()
1414 Output . WriteLine ( $ "1Script Execution Engine. Version { Program . GetVersion ( ) } ") ;
1515 Output . WriteLine ( ) ;
1616 Output . WriteLine ( "Usage:" ) ;
17+ Output . WriteLine ( " oscript.exe [options] <script_path> [script_arguments...]" ) ;
18+ Output . WriteLine ( " oscript.exe <mode> [mode_options] <script_path> [script_arguments...]" ) ;
1719 Output . WriteLine ( ) ;
18- Output . WriteLine ( "I. Script execution: oscript.exe <script_path> [script arguments..]" ) ;
19- Output . WriteLine ( ) ;
20- Output . WriteLine ( "II. Special mode: oscript.exe <mode> <script_path> [script arguments..]" ) ;
21- Output . WriteLine ( "Mode can be one of these:" ) ;
22- Output . WriteLine ( $ " { "-measure" , - 12 } measures execution time") ;
23- Output . WriteLine ( $ " { "-compile" , - 12 } shows compiled module without execution") ;
24- Output . WriteLine ( $ " { "-check [-env=<entrypoint-file>]" , - 12 } provides syntax check") ;
25- Output . WriteLine ( $ " { "-check -cgi" , - 12 } provides syntax check in CGI-mode") ;
26- Output . WriteLine ( $ " { "-version" , - 12 } output version string") ;
20+
21+ const int modeWidth = - 18 ;
22+ const int subOptionWidth = - 14 ;
23+
24+ Output . WriteLine ( "Modes:" ) ;
25+ Output . WriteLine ( $ " { "-measure" , modeWidth } Measures script execution time.") ;
26+ Output . WriteLine ( $ " { "-compile" , modeWidth } Shows compiled module without execution.") ;
27+ Output . WriteLine ( $ " { "-check" , modeWidth } Provides syntax check.") ;
28+ Output . WriteLine ( $ " { "" , modeWidth } Options:") ;
29+ Output . WriteLine ( $ " { "" , modeWidth } { "-cgi" , subOptionWidth } Syntax check in CGI-mode.") ;
30+ Output . WriteLine ( $ " { "" , modeWidth } { "-env=<file>" , subOptionWidth } Path to entrypoint file for context.") ;
31+
32+ Output . WriteLine ( $ " { "-debug" , modeWidth } Runs script in debug mode.") ;
33+ Output . WriteLine ( $ " { "" , modeWidth } Options:") ;
34+ Output . WriteLine ( $ " { "" , modeWidth } { "-port=<port>" , subOptionWidth } Debugger port (default is 2801).") ;
35+ Output . WriteLine ( $ " { "" , modeWidth } { "-noWait" , subOptionWidth } Do not wait for debugger connection.") ;
36+
37+ Output . WriteLine ( $ " { "-version, -v" , modeWidth } Output version string.") ;
2738 Output . WriteLine ( ) ;
28- Output . WriteLine ( " -encoding=<encoding-name> set output encoding" ) ;
29- Output . WriteLine ( " -codestat=<filename> write code statistics" ) ;
39+
40+ Output . WriteLine ( "Options:" ) ;
41+ Output . WriteLine ( $ " { "-encoding=<name>" , modeWidth } Set output encoding (e.g. utf-8).") ;
42+ Output . WriteLine ( $ " { "-codestat=<file>" , modeWidth } Write code execution statistics to file.") ;
3043 Output . WriteLine ( ) ;
31- Output . WriteLine ( "III. Run as CGI application: oscript.exe -cgi <script_path> [script arguments..]" ) ;
32- Output . WriteLine ( " Runs as CGI application under HTTP-server (Apache/Nginx/IIS/etc...)" ) ;
44+
45+ Output . WriteLine ( "CGI Mode:" ) ;
46+ Output . WriteLine ( " oscript.exe -cgi <script_path> [script_arguments...]" ) ;
47+ Output . WriteLine ( " Runs as CGI application under HTTP-server." ) ;
3348
3449 return 0 ;
3550 }
0 commit comments