Changeset 595

Show
Ignore:
Timestamp:
05/09/07 04:51:43 (1 year ago)
Author:
Gregor
Message:

sss/main.d: Tangofied.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/tango/sss/main.d

    r589 r595  
    2929module sss.main; 
    3030 
    31 import std.file; 
    32 import std.path; 
    33 import std.stdio; 
    34 import std.string; 
    35  
    36 import std.c.stdlib; 
     31import tango.io.Console; 
     32import tango.io.FilePath; 
     33import tango.io.FileSystem; 
     34 
     35import tango.stdc.stdlib; 
    3736 
    3837import sss.build; 
     
    136135            } else if (arg == "net") { 
    137136                version (DSSS_Light) { 
    138                     writefln("The 'net' command is not supported in DSSS Light")
     137                    Cout("The 'net' command is not supported in DSSS Light").newline
    139138                    exit(1); 
    140139                } else { 
     
    148147                 
    149148            } else { 
    150                 writefln("Unrecognized argument: %s", arg)
     149                Cout("Unrecognized argument: ")(arg).newline
    151150                exit(1); 
    152151            } 
     
    195194                i++; 
    196195                if (i >= args.length) { 
    197                     writefln("Argument expected after %s", arg)
     196                    Cout("Argument expected after ")(arg).newline
    198197                    return 1; 
    199198                } 
     
    273272char[] makeAbsolute(char[] path) 
    274273{ 
    275     if (!isabs(path)) { 
    276         return getcwd() ~ std.path.sep ~ path; 
     274    if (!(new FilePath(path)).isAbsolute()) { 
     275        return FileSystem.getDirectory() ~ std.path.sep ~ path; 
    277276    } 
    278277    return path; 
     
    282281{ 
    283282    if (command == cmd_t.NONE) { 
    284         writefln
     283        Cout
    285284`DSSS version ` ~ DSSS_VERSION ~ ` 
    286285Usage: dsss [dsss options] <command> [options] 
     
    293292    install:   install all or some binaries or libraries 
    294293    uninstall: uninstall a specified tool or library 
    295     installed: list installed software`)
     294    installed: list installed software`).newline
    296295        version(DSSS_Light) {} else { 
    297             writefln
    298 `    net:       Internet-based installation and package management`)
     296            Cout
     297`    net:       Internet-based installation and package management`).newline
    299298        } 
    300         writefln
    301 `    genconfig: generate a config file`)
     299        Cout
     300`    genconfig: generate a config file`).newline
    302301         
    303302    } else if (command == cmd_t.BUILD) { 
    304         writefln
     303        Cout
    305304`Usage: dsss [dsss options] build [build options] [sources, binaries or packages]` 
    306             )
     305            ).newline
    307306         
    308307    } else if (command == cmd_t.CLEAN) { 
    309         writefln
     308        Cout
    310309`Usage: dsss [dsss options] clean [clean options] [sources, binaries or packages]` 
    311             )
     310            ).newline
    312311         
    313312    } else if (command == cmd_t.DISTCLEAN) { 
    314         writefln
     313        Cout
    315314`Usage: dsss [dsss options] distclean [distclean options] [sources, binaries or packages]` 
    316             )
     315            ).newline
    317316         
    318317    } else if (command == cmd_t.INSTALL) { 
    319         writefln
     318        Cout
    320319`Usage: dsss [dsss options] install [install options] [sources, binaries or packages]` 
    321             )
     320            ).newline
    322321         
    323322    } else if (command == cmd_t.UNINSTALL) { 
    324         writefln
     323        Cout
    325324`Usage: dsss [dsss options] uninstall [uninstall options] <tools or libraries>` 
    326             )
     325            ).newline
    327326         
    328327    } else if (command == cmd_t.INSTALLED) { 
    329         writefln
     328        Cout
    330329`Usage: dsss [dsss options] installed` 
    331             )
     330            ).newline
    332331         
    333332    } else if (command == cmd_t.NET) { 
    334         writefln
     333        Cout
    335334`Usage: dsss [dsss options] net <net command> [options] <package name> 
    336335  Net Commands: 
     
    342341    list:    list all installable packages 
    343342    search:  find an installable package by name` 
    344             )
     343            ).newline
    345344 
    346345         
    347346    } else if (command == cmd_t.GENCONFIG) { 
    348         writefln
     347        Cout
    349348`Usage: dsss [dsss options] genconfig [install options] [sources, binaries or packages]` 
    350             )
    351          
    352     } 
    353      
    354     writefln
     349            ).newline
     350         
     351    } 
     352     
     353    Cout
    355354`  Generic options (must proceed the command): 
    356355    --help: display specific options and information 
     
    366365    --scratchdir=<dir> [default /tmp] 
    367366 
    368   All other options are passed through to rebuild and ultimately the compiler.`)
    369          
    370 } 
     367  All other options are passed through to rebuild and ultimately the compiler.`).newline
     368         
     369}