1   // joi/6/juno/MkdirCommand.java                         
2   //                                                            
3   //                                                            
4   // Copyright 2003, Ethan Bolker and Bill Campbell                         
5                                                               
6   import java.util.*;
7   
8   /**
9    * The Juno shell command to create a new directory.
10   * Usage:
11   * <pre>
12   *     mkdir directory-name
13   * </pre>
14   *
15   * @version 6
16   */
17  
18  public class MkdirCommand extends ShellCommand 
19  {
20      /**
21       * Construct a MkdirCommand object.
22       */
23  
24      public MkdirCommand() 
25      {
26          super( "create a subdirectory of the current directory",
27                 "directory-name" );
28      }
29  
30      /**
31       * Create a new Directory in the current Directory.    
32       *
33       * @param args the remainder of the command line.
34       * @param sh the current shell
35       */
36  
37      public void doIt( StringTokenizer args, Shell sh )
38      {
39          String filename = args.nextToken();
40          new Directory( filename, sh.getUser(), sh.getDot() );
41      }
42  }
43