mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
20.14.2007 7dc96d33e92d8cf41f60c012a0e99ca6650eed62
Set MAX_LINE_WIDTH to the value of the COLUMNS environment variable if it is available.
1 files modified
14 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/util/ServerConstants.java 14 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/util/ServerConstants.java
@@ -2488,7 +2488,19 @@
  /**
   * The column at which to wrap long lines of output in the command-line tools.
   */
  public static final int MAX_LINE_WIDTH = 79;
  public static final int MAX_LINE_WIDTH;
  static {
    int columns = 80;
    try {
      String s = System.getenv("COLUMNS");
      if (s != null) {
        columns = Integer.parseInt(s);
      }
    } catch (Exception e) {
      // Do nothing.
    }
    MAX_LINE_WIDTH = columns - 1;
  }