Changeset 1738

Show
Ignore:
Timestamp:
11/07/08 15:39:03 (2 months ago)
Author:
Chuck.Esterbrook
Message:

Added -out: command line option.

Location:
cobra/trunk
Files:
2 added
3 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Developer/IntermediateReleaseNotes.text

    r1733 r1738  
    2222        # the fully general form is: 
    2323        (get|pro|set) <name> from (var|<varName>) as <type> 
     24 
     25* Added -out: command line option. 
    2426 
    2527* Modified commandline options so -r becomes synonym for -run rather   
  • cobra/trunk/Source/CommandLine.cobra

    r1723 r1738  
    282282                        'type': 'bool', 
    283283                        'description': 'Enable optimizations.', 
     284                }, 
     285                { 
     286                        'name': 'out', 
     287                        'type': 'string', 
     288                        'description': 'Specify output file name (default: base name of first file). -test overrides this with a temporary program that runs only the unit tests and is then removed afterwards.', 
     289                        'args': 'FILENAME', 
    284290                }, 
    285291                { 
     
    12541260                        return false 
    12551261 
     1262        def get(key as String) as dynamic? 
     1263                return this[key] 
     1264 
    12561265        def getDefault(key as String, default as dynamic?) as dynamic? 
    12571266                if .containsKey(key) 
  • cobra/trunk/Source/SharpGenerator.cobra

    r1733 r1738  
    133133 
    134134                        # exe names 
    135                         outName = if(options.boolValue('test'), _modules[_modules.count-1].sharpFileName, _firstFileName to !) 
     135                        if options.boolValue('test') 
     136                                outName = _modules[_modules.count-1].sharpFileName 
     137                        else if options.containsKey('out') 
     138                                outName = options.get('out') 
     139                        else 
     140                                outName = _firstFileName to ! 
    136141                        if outName.endsWith('.cs') or outName.endsWith('.CS'), outName = outName[:-3] 
    137142                        if outName.endsWith('.cobra') or outName.endsWith('.COBRA'), outName = outName[:-6] 
     143                        target = options.getDefault('target', 'exe') 
     144                        if target in ['exe', 'winexe'] and (outName.endsWith('.exe') or outName.endsWith('.EXE')) 
     145                                outName = outName[:-4]  # csc always adds the extension itself 
     146                        else if target == 'lib' and (outName.endsWith('.dll') or outName.endsWith('.DLL')) 
     147                                outName = outName[:-4] 
    138148                        _baseExeFileName = outName 
    139149