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

matthew_swift
20.14.2007 0eba52c4e464860acd93b0fabce711173992f1ff
Set MAX_LINE_WIDTH to the value of the COLUMNS environment variable if it is available.
1 files modified
14 ■■■■■ changed files
opends/src/server/org/opends/server/util/ServerConstants.java 14 ●●●●● patch | view | raw | blame | history
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;
  }