/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * See LICENSE.txt included in this distribution for the specific * language governing permissions and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at LICENSE.txt. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. * * Portions Copyright 2011 Jens Elkner. */ package org.opensolaris.opengrok.index; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.StringWriter; import java.text.DateFormat; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; import org.opensolaris.opengrok.util.IOUtils; public class CommandLineOptions { private static final String ON_OFF = "on/off"; private static final String NUMBER = "number"; static class Option { char option; String argument; String description; public Option(char opt, String arg, String descr) { option = opt; argument = arg; description = descr; } public String getUsage() { StringBuilder sb = new StringBuilder(); sb.append('-'); sb.append(option); if (argument != null) { sb.append(' '); sb.append(argument); } sb.append("\n\t"); sb.append(description); return sb.toString(); } } private final List