JAL-629 Fix --tempfac. Hide non-working --notempfac. Add --scale, --width, --height...
[jalview.git] / src / jalview / bin / Cache.java
index 769c868..f4c8854 100755 (executable)
@@ -383,10 +383,13 @@ public class Cache
         {
           // props file provided as URL
           fis = new URL(propertiesFile).openStream();
-          System.out.println(
-                  "Loading jalview properties from : " + propertiesFile);
-          System.out.println(
-                  "Disabling Jalview writing to user's local properties file.");
+          if (!Jalview.quiet())
+          {
+            System.out.println(
+                    "Loading jalview properties from : " + propertiesFile);
+            System.out.println(
+                    "Disabling Jalview writing to user's local properties file.");
+          }
           propsAreReadOnly = true;
         } catch (Exception ex)
         {
@@ -414,7 +417,8 @@ public class Cache
         fis.close();
       } catch (Exception ex)
       {
-        System.out.println("Error reading properties file: " + ex);
+        if (!Jalview.quiet())
+          System.out.println("Error reading properties file: " + ex);
       }
     }
 
@@ -470,7 +474,8 @@ public class Cache
       }
     } catch (Exception ex)
     {
-      System.out.println("Error reading author details: " + ex);
+      if (!Jalview.quiet())
+        System.out.println("Error reading author details: " + ex);
       authorDetails = null;
     }
     if (authorDetails == null)
@@ -554,10 +559,13 @@ public class Cache
               remoteVersion = remoteBuildProperties.getProperty("VERSION");
             } catch (Exception ex)
             {
-              System.out.println(
-                      "Non-fatal exception when checking version at "
-                              + remoteBuildPropertiesUrl + ":");
-              System.out.println(ex);
+              if (!Jalview.quiet())
+              {
+                System.out.println(
+                        "Non-fatal exception when checking version at "
+                                + remoteBuildPropertiesUrl + ":");
+                System.out.println(ex);
+              }
               remoteVersion = getProperty("VERSION");
             }
           }
@@ -656,7 +664,8 @@ public class Cache
       }
     } catch (Exception ex)
     {
-      System.out.println("Error reading build details: " + ex);
+      if (!Jalview.quiet())
+        System.out.println("Error reading build details: " + ex);
       applicationProperties.remove("VERSION");
     }
     String codeVersion = getProperty("VERSION");
@@ -676,11 +685,8 @@ public class Cache
     new BuildDetails(codeVersion, null, codeInstallation);
     if (printVersion && reportVersion)
     {
-      if (!Jalview.quiet())
-      {
-        System.out.println(ChannelProperties.getProperty("app_name")
-                + " Version: " + codeVersion + codeInstallation);
-      }
+      System.out.println(ChannelProperties.getProperty("app_name")
+              + " version: " + codeVersion + codeInstallation);
     }
   }
 
@@ -741,8 +747,9 @@ public class Cache
         def = Integer.parseInt(string);
       } catch (NumberFormatException e)
       {
-        System.out.println("Error parsing int property '" + property
-                + "' with value '" + string + "'");
+        if (!Jalview.quiet())
+          System.out.println("Error parsing int property '" + property
+                  + "' with value '" + string + "'");
       }
     }
 
@@ -783,8 +790,9 @@ public class Cache
       }
     } catch (Exception ex)
     {
-      System.out.println(
-              "Error setting property: " + key + " " + obj + "\n" + ex);
+      if (!Jalview.quiet())
+        System.out.println(
+                "Error setting property: " + key + " " + obj + "\n" + ex);
     }
     return oldValue;
   }
@@ -814,7 +822,8 @@ public class Cache
         out.close();
       } catch (Exception ex)
       {
-        System.out.println("Error saving properties: " + ex);
+        if (!Jalview.quiet())
+          System.out.println("Error saving properties: " + ex);
       }
     }
   }
@@ -1152,7 +1161,8 @@ public class Cache
         }
       } catch (Exception ex)
       {
-        System.out.println("Error loading User ColourFile\n" + ex);
+        if (!Jalview.quiet())
+          System.out.println("Error loading User ColourFile\n" + ex);
       }
     }
     if (!files.equals(coloursFound.toString()))