wasCSharpSQLite – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 /*
2 * CdCmd.java
3 *
4 * This file contains the Jacl implementation of the built-in Tcl "cd"
5 * command.
6 *
7 * Copyright (c) 1997 Sun Microsystems, Inc.
8 *
9 * See the file "license.terms" for information on usage and
10 * redistribution of this file, and for a DISCLAIMER OF ALL
11 * WARRANTIES.
12 *
13 * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart
14 *
15 * RCS @(#) $Id: CdCmd.java,v 1.2 1999/05/08 23:53:08 dejong Exp $
16 *
17 */
18 using System;
19 namespace tcl.lang
20 {
21  
22 // This class implements the built-in "cd" command in Tcl.
23  
24 class CdCmd : Command
25 {
26  
27 public TCL.CompletionCode cmdProc( Interp interp, TclObject[] argv )
28 {
29 string dirName;
30  
31 if ( argv.Length > 2 )
32 {
33 throw new TclNumArgsException( interp, 1, argv, "?dirName?" );
34 }
35  
36 if ( argv.Length == 1 )
37 {
38 dirName = "~";
39 }
40 else
41 {
42  
43 dirName = argv[1].ToString();
44 }
45 if ( ( JACL.PLATFORM == JACL.PLATFORM_WINDOWS ) && ( dirName.Length == 2 ) && ( dirName[1] == ':' ) )
46 {
47 dirName = dirName + "/";
48 }
49  
50 // Set the interp's working dir.
51  
52 interp.setWorkingDir( dirName );
53 return TCL.CompletionCode.RETURN;
54 }
55 } // end CdCmd class
56 }