/*
 * A CCNx command line utility.
 *
 * Copyright (C) 2011 Palo Alto Research Center, Inc.
 *
 * This work is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License version 2 as published by the
 * Free Software Foundation. 
 * This work is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 * for more details. You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

package org.ccnx.ccn.utils;

import java.util.logging.Level;

import org.ccnx.ccn.impl.support.Log;

public abstract class CommonArguments {
	
	public static boolean parseArguments(String[] args, int i, Usage u) {
		boolean ret = true;
		if (args[i].equals("-unversioned")) {
			CommonParameters.unversioned = true;
		} else if (args[i].equals("-timeout")) {
			if (args.length < (i + 2)) {
				u.usage();
			}
			try {
				CommonParameters.timeout = Integer.parseInt(args[i++]);
			} catch (NumberFormatException nfe) {
				u.usage();
			}
		} else if (args[i].equals("-log")) {
			Level level = null;
			if (args.length < (i + 2)) {
				u.usage();
			}
			try {
				level = Level.parse(args[++i]);
			} catch (NumberFormatException nfe) {
				u.usage();
			}
			Log.setLevel(Log.FAC_ALL, level);
		} else if (args[i].equals("-as")) {
			if (args.length < (i + 2)) {
				u.usage();
			}
			CommonSecurity.setUser(args[++i]);
		} else if (args[i].equals("-ac")) {
			CommonSecurity.setAccessControl();
		} else {
			ret = false;
		}
		if (CommonParameters.startArg < i)
			CommonParameters.startArg = i;
		return ret;
	}
}

@@ -1532,16 +1532,89 @@
 level);%0A
+%09%09%7D else if (args%5Bi%5D.equals(%22-v%22)) %7B%0A%09%09%09CommonParameters.verbose = true;%0A
 %09%09%7D else

Add verbose into common args