[Mono-devel-list] Mono.GetOptions got new features

Rafael Teixeira monoman at gmail.com
Mon Feb 28 17:27:34 EST 2005


Landed on SVN HEAD, some small new features for Mono.GetOptions (that
mbas is already using).

Changed Mono.GetOptions/OptionAttribute.cs,
Mono.GetOptions/OptionDetails.cs, Mono.GetOptions/OptionList

============
*1* Implemented support for vbc style booleans: /debug+ /debug- . 
* Usage: 

[Option("Emit debug information", "debug", VBCStyleBoolean = true)]
public bool GenerateDebugInfo;

* Output: /help gives one line like this:
...
     -debug[+|-]             Emit debugging information
...

============
*2* Implemented support for second level help screen. 
* Usage: 

[Option("advanced stuff", "arcana", SecondLevelHelp = true)]
public bool Arcana;

A /help2 new option is automatically added

============
*3* Better alignment for option descriptions, specially multiline,
including expansion of tabs. Now it calculates precisely what is the
needed spacing.

See example output from mbas:
<snip>
$ mbas /help
MonoBASIC Compiler  0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira
This is a compiler for the MonoBASIC language,
which is a superset of Visual Basic.NET
 
Usage: mbas [options] SOURCE-FILES
Options:
     -about                  About the MonoBASIC compiler
     -addmodule:module-list  Imports all type information from files
in the module-list. {module-list}:module,...
  -g -debug[+|-]             Emit debugging information
  -d -define:symbol-list     Declares global conditional compilation
symbol(s). symbol-list:name=value,...
  -? -help                   Show this help list
     -help2                  Show an additional help list
     -imports:import-list    Declare global Imports for listed
namespaces. import-list:namespace,...
     -libpath:path-list      List of directories to search for
metadata references. path-list:path,... [short form: -lib]
  -m -main:name              Specifies the name of the Class or Module
that contains Sub Main or inherits from System.Windows.Forms.Form.
                             Needed to select among many entry-points
for a program (target=exe|winexe)
     -nologo                 Do not display compiler copyright banner
  -o -out:file               Specifies the output file name
     -pkg:packagelist        [Mono] References packages listed.
packagelist=package,...
  -r -reference:assembly     References metadata from the specified assembly
     -resource:file          Adds the specified file as an embedded
assembly resource [short form: -res]
  -t -target:type            Specifies the target type for the output
file (exe [default], winexe, library, module)
</snip>

Now the second help screen (diferently aligned)

<snip>
$ mbas /help2
MonoBASIC Compiler  0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira
This is a compiler for the MonoBASIC language,
which is a superset of Visual Basic.NET
 
Usage: mbas [options] SOURCE-FILES
Options:
     -debug-args:arguments     [Mono] Debugger arguments
     -debug:full               Emit full debugging information (default)
     -debug:pdbonly            [IGNORED] Emit PDB file only
     -fatal                    [Mono] Makes errors fatal
     -ignorewarn:XXXX          [Mono] Ignores warning number XXXX
     -noconfig                 [Mono] Disables implicit references to assemblies
     -nostdlib                 [Mono] Don't assume the standard library
     -nowarn                   Disable warnings
     -parse                    [Mono] Only parses the source file (for
debugging the tokenizer)
  -q -quiet                    Commands the compiler to show only
error messages for syntax-related errors and warnings
     -removeintchecks[+|-]     Remove integer checks. Default off.
     -rootnamespace:namespace  Specifies the root namespace for all
type declarations
     -stacktrace               [Mono] Shows stack trace at Error location
     -timestamp                [Mono] Displays time stamps of various
compiler events
     -tokenize                 [Mono] Only tokenizes source files
     -unsafe                   [Mono] Allows unsafe code
     -usage                    Show usage syntax and exit
     -utf8output[+|-]          [IGNORED] Emit compiler output in UTF8
character encoding
  -v -verbose                  Display verbose messages
     -verbosegetoptions        Show verbose parsing of options
     -warnaserror              Treat warnings as errors
     -wlevel:level             [Mono] Sets warning level (the highest
is 4, the default)
</snip>

* Detail: The multiline description for /main is achieved now simply
by embedding '\t' in the description string, see:

[Option("Specifies the {name} of the Class or Module that contains Sub
Main or inherits from System.Windows.Forms.Form.\tNeeded to select
among many entry-points for a program (target=exe|winexe)", 'm',
"main")]
public string main { set { RootContext.MainClass = value; } }

============
*4* ArgumentProcessor-marked method now is called while processing
options to allow positional processing
 
Example:

xxx /pre+ source1.zzz source2.zzz /pre- source3.zzz

While processing first two files process with pre turned on, and the
last one with pre turned off.

Enjoy,

-- 
Rafael "Monoman" Teixeira
---------------------------------------
I'm trying to become a "Rosh Gadol" before my own eyes. 
See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment.



More information about the Mono-devel-list mailing list