Print

Print


Author: [log in to unmask]
Date: Thu Mar  5 16:56:14 2015
New Revision: 2277

Log:
Add option for specifying conditions tag to print command.  HPSJAVA-447

Modified:
    java/trunk/conditions/src/main/java/org/hps/conditions/cli/PrintCommand.java

Modified: java/trunk/conditions/src/main/java/org/hps/conditions/cli/PrintCommand.java
 =============================================================================
--- java/trunk/conditions/src/main/java/org/hps/conditions/cli/PrintCommand.java	(original)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/cli/PrintCommand.java	Thu Mar  5 16:56:14 2015
@@ -40,11 +40,11 @@
     PrintCommand() {
         super("print", "Print the table data for a conditions set");
         this.options.addOption(new Option("t", true, "Set the table name"));
-        this.options.addOption(new Option("a", false, "Use all available conditions for the run number and key name"));
         this.options.addOption(new Option("i", false, "Print the ID for the records (off by default)"));
         this.options.addOption(new Option("f", true, "Write print output to a file"));
         this.options.addOption(new Option("H", false, "Suppress printing of conditions record and table info"));
-        this.options.addOption(new Option("T", false, "Use tabs for field delimiter instead of spaces"));
+        this.options.addOption(new Option("d", false, "Use tabs for field delimiter instead of spaces"));
+        this.options.addOption(new Option("T", true, "Specify a conditions tag to use for filtering records"));
     }
     
     /**
@@ -55,11 +55,12 @@
         super.execute(arguments);
         
         DatabaseConditionsManager conditionsManager = DatabaseConditionsManager.getInstance();
-        if (!this.verbose) {
-            // If not running in verbose mode then only print severe errors from conditions manager.
-            conditionsManager.setLogLevel(Level.SEVERE);
+        
+        // User specified tag of conditions records.
+        if (this.commandLine.hasOption("T")) {
+            conditionsManager.setTag(commandLine.getOptionValue("T"));
         }
-        
+               
         // Print conditions sets matching a specific conditions key.
         String userConditionsKey = null;
         if (this.commandLine.hasOption("t")) {
@@ -92,7 +93,7 @@
         }
 
         // Use tabs instead of spaces for field delimiter.
-        if (this.commandLine.hasOption("T")) {
+        if (this.commandLine.hasOption("d")) {
             fieldDelimiter = '\t';
         }