Changeset 211 in xtideuniversalbios for trunk/Serial_Server/win32/Win32.cpp


Ignore:
Timestamp:
Jan 16, 2012, 7:23:11 PM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

More minor changes, improved usage message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Serial_Server/win32/Win32.cpp

    r209 r211  
    2121{
    2222    char *usageStrings[] = {
    23         "usage: SerServe [options] master-imagefile [[slave-options] slave-imagefile]",
     23        "SerDrive - XTIDE Universal BIOS Serial Drive Server",
     24        "Version 1.2.0_wip, Built " __DATE__,
     25        "",
     26        "usage: SerDrive [options] imagefile [[slave-options] slave-imagefile]",
     27        "",
    2428        "  -g cyl:sect:head  Geometry in cylinders, sectors per cylinder, and heads",
    2529        "                    (default is 65:63:16 for a 32 MB disk)",
    26         "  -n [megabytes]    New, Create new disk with given size or use -g geometry",
    27         "  -p                Named pipe mode for emulators (pipe is " PIPENAME ")",
    28         "  -c PortNumber     COM Port to use (default is first found)",
     30        "",
     31        "  -n [megabytes]    Create new disk with given size or use -g geometry",
     32        "",
     33        "  -p                Named Pipe mode for emulators (pipe is '" PIPENAME "')",
     34        "",
     35        "  -c COMPortNumber  COM Port to use (default is first found)",
     36        "",
    2937        "  -b BaudRate       Baud rate to use on the COM port ",
    30         "                    9600, 38400, 115200, 230400, or 460800",   
    31         "                    (default 9600, 115200 in pipe mode)",
     38        "                    Without a rate multiplier: 2400, 9600, 38400, 115200",
     39        "                    With a 2x rate multiplier: 4800, 19200, 76800, 230400",
     40        "                    With a 4x rate multiplier: 9600, 38400, 153600, 460800",
     41        "                    Abbreviations also accepted (ie, '460K', '38.4K', etc)",
     42        "                    (default is 9600, 115200 in named pipe mode)",
     43        "",
    3244        "  -t                Disable timeout, useful for long delays when debugging",
    33         "  -r                Read Only disk",
    34         "  -v [level]        Reporting level 1-6, increasing information",
     45        "",
     46        "  -r                Read Only disk, do not allow writes",
     47        "",
     48        "  -v [level]        Reporting level 1-6, with increasing information",
    3549        NULL };
    3650
     
    4155}
    4256
    43 int verbose = 1;
     57int verbose = 0;
    4458
    4559int main(int argc, char* argv[])
     
    158172
    159173        if( serial->resetConnection )
    160             log( 1, "==== Resetting Connection ====" );
     174            log( 0, "Connection closed, reset..." );
    161175    }
    162176    while( serial->resetConnection );
     
    169183    va_start( args, message );
    170184
    171     if( level == 0 )
    172     {
    173       vfprintf( stderr, message, args );
    174       fprintf( stderr, "\n" );
    175       exit( 1 );
     185    if( level < 0 )
     186    {
     187        fprintf( stderr, "ERROR: " );
     188        vfprintf( stderr, message, args );
     189        fprintf( stderr, "\n" );
     190        exit( 1 );
    176191    }
    177192    else if( verbose >= level )
    178193    {
    179       vprintf( message, args );
    180       printf( "\n" );
     194        vprintf( message, args );
     195        printf( "\n" );
    181196    }
    182197
Note: See TracChangeset for help on using the changeset viewer.