Attached are patches for MSVSS.java, MSVSSGET.java and MSVSSLABEL.java.
These allow GET to be run in "quiet" mode and LABEL to be run with an
autoresponse (which means you can automatically replace an old label,
should you wish to). I've also added "autoresponse" to the JavaDoc
comment for GET, "comment" to the JavaDoc comment for LABEL, and tidied
up the GET JavaDocs (which had <tr> instead of </tr> in the table).

Jon
--- MSVSSLABEL.java.original    Tue Jun 12 13:33:15 2001
+++ MSVSSLABEL.java     Tue Jun 12 13:47:26 2001
@@ -93,13 +93,25 @@
  *      <td>An existing file or project version to label</td>
  *      <td>No</td>
  *   </tr>
+ *   <tr>
+ *      <td>autoresponse</td>
+ *      <td>What to respond with (sets the -I option). By default, -I- is
+ *      used; values of Y or N will be appended to this.</td>
+ *      <td>No</td>
+ *   </tr>
+ *   <tr>
+ *      <td>comment</td>
+ *      <td>The comment to use for this label. Empty or '-' for no 
comment.</td>
+ *      <td>No</td>
+ *   </tr>
+ *      
  * </table>
  *
  * @author Phillip Wells
  */
 public class MSVSSLABEL extends MSVSS
 {
-
+    private String m_AutoResponse = null;
     private String m_Label = null;
     private String m_Version = null;
     private String m_Comment = "-";
@@ -140,8 +152,8 @@
         // -C
         commandLine.createArgument().setValue("-C"+getComment());
 
-        // -I-
-        commandLine.createArgument().setValue("-I-");  // ignore all errors
+        // -I- or -I-Y or -I-N
+        getAutoresponse(commandLine);
 
         // -L
         // Specify the new label on the command line (instead of being 
prompted)
@@ -242,5 +254,34 @@
      */
     public String getComment() {
         return m_Comment;
+    }
+    
+    public void setAutoresponse(String response){
+        if ( response.equals("") || response.equals("null") ) {
+            m_AutoResponse = null;
+        } else {
+            m_AutoResponse = response;
+        }
+    }
+    
+    /**
+     * Checks the value set for the autoResponse.
+     * if it equals "Y" then we return -I-Y
+     * if it equals "N" then we return -I-N
+     * otherwise we return -I
+     */
+    public void getAutoresponse(Commandline cmd) {
+        
+        if ( m_AutoResponse == null) {
+            cmd.createArgument().setValue(FLAG_AUTORESPONSE_DEF);
+        } else if ( m_AutoResponse.equalsIgnoreCase("Y")) {
+            cmd.createArgument().setValue(FLAG_AUTORESPONSE_YES);
+            
+        } else if ( m_AutoResponse.equalsIgnoreCase("N")) {
+            cmd.createArgument().setValue(FLAG_AUTORESPONSE_NO);
+        }else {
+            cmd.createArgument().setValue(FLAG_AUTORESPONSE_DEF);
+        } // end of else
+
     }
 }
--- MSVSSGET.java.original      Tue Jun 12 13:28:29 2001
+++ MSVSSGET.java       Tue Jun 12 13:37:27 2001
@@ -74,42 +74,53 @@
  *      <td>login</td>
  *      <td>username,password</td>
  *      <td>No</td>
- *   <tr>
+ *   </tr>
  *   <tr>
  *      <td>vsspath</td>
  *      <td>SourceSafe path</td>
  *      <td>Yes</td>
- *   <tr>
+ *   </tr>
  *   <tr>
  *      <td>localpath</td>
  *      <td>Override the working directory and get to the specified path</td>
  *      <td>No</td>
- *   <tr>
+ *   </tr>
  *   <tr>
  *      <td>writable</td>
  *      <td>true or false</td>
  *      <td>No</td>
- *   <tr>
+ *   </tr>
  *   <tr>
  *      <td>recursive</td>
  *      <td>true or false</td>
  *      <td>No</td>
- *   <tr>
+ *   </tr>
  *   <tr>
  *      <td>version</td>
  *      <td>a version number to get</td>
  *      <td>No</td>
- *   <tr>
+ *   </tr>
  *   <tr>
  *      <td>date</td>
  *      <td>a date stamp to get at</td>
  *      <td>No</td>
- *   <tr>
+ *   </tr>
  *   <tr>
  *      <td>label</td>
  *      <td>a label to get for</td>
  *      <td>No</td>
+ *   </tr>
+ *   <tr>
+ *      <td>quiet</td>
+ *      <td>suppress output (off by default)</td>
+ *      <td>No</td>
+ *   </tr>
  *   <tr>
+ *      <td>autoresponse</td>
+ *      <td>What to respond with (sets the -I option). By default, -I- is
+ *      used; values of Y or N will be appended to this.</td>
+ *      <td>No</td>
+ *   </tr>
  * </table>
  * <p>Note that only one of version, date or label should be specified</p>
  *
@@ -125,6 +136,7 @@
     private String m_Date = null;
     private String m_Label = null;
     private String m_AutoResponse = null;
+    private boolean m_Quiet = false;
 
     /**
      * Executes the task.
@@ -156,6 +168,8 @@
         getLocalpathCommand(commandLine);
         // -I- or -I-Y or -I-N
         getAutoresponse(commandLine);
+        // -O-
+        getQuietCommand(commandLine);
         // -R
         getRecursiveCommand(commandLine);
         // -V
@@ -222,6 +236,19 @@
         }
     }
 
+    /**
+     * Sets/clears quiet mode
+     */
+    public final void setQuiet (boolean quiet) {
+        this.m_Quiet=quiet;
+    }
+    
+    public void getQuietCommand (Commandline cmd) {
+        if (m_Quiet) {
+            cmd.createArgument().setValue (FLAG_QUIET);
+        }
+    }
+    
     /**
      * Set behaviour, used in get command to make files that are 'got' writable
      */
--- MSVSS.java.original Tue Jun 12 13:28:07 2001
+++ MSVSS.java  Tue Jun 12 13:24:18 2001
@@ -242,5 +242,7 @@
     public static final String VALUE_NO = "-N";
     /** */
     public static final String VALUE_YES = "-Y";
+    /** */
+    public static final String FLAG_QUIET = "-O-";
 }
 

Reply via email to