/*
* Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
* Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* Jalview 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 Jalview. If not, see .
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.bin;
import java.net.URLDecoder;
import java.util.Vector;
/**
* Notes: this argParser does not distinguish between parameter switches,
* parameter values and argument text. If an argument happens to be identical to
* a parameter, it will be taken as such (even though it didn't have a '-'
* prefixing it).
*
* @author Andrew Waterhouse and JBP documented.
*
*/
public class ArgsParser
{
// BH 2019 - new
public static final String NOCALCULATION = "nocalculation";
public static final String NOMENUBAR = "nomenubar";
public static final String NOSTATUS = "nostatus";
public static final String SHOWOVERVIEW = "showoverview";
//
public static final String ANNOTATIONS = "annotations";
public static final String COLOUR = "colour";
public static final String FEATURES = "features";
public static final String GROOVY = "groovy";
public static final String GROUPS = "groups";
public static final String HEADLESS = "headless";
public static final String JABAWS = "jabaws";
public static final String NOANNOTATION = "no-annotation";
public static final String NOANNOTATION2 = "noannotation"; // BH 2019.05.07
public static final String NODISPLAY = "nodisplay";
public static final String NOGUI = "nogui";
public static final String NONEWS = "nonews";
public static final String NOQUESTIONNAIRE = "noquestionnaire";
public static final String NOSORTBYTREE = "nosortbytree";
public static final String NOUSAGESTATS = "nousagestats";
public static final String OPEN = "open";
public static final String OPEN2 = "open2"; // BH added -- for applet
// compatibility; not fully
// implemented
public static final String PROPS = "props";
public static final String QUESTIONNAIRE = "questionnaire";
public static final String SETPROP = "setprop";
public static final String SORTBYTREE = "sortbytree";
public static final String TREE = "tree";
public static final String VDOC = "vdoc";
public static final String VSESS = "vsess";
private Vector vargs = null;
private boolean isApplet;
private AppletParams appletParams;
public boolean isApplet()
{
return isApplet;
}
public ArgsParser(String[] args)
{
vargs = new Vector<>();
isApplet = (args.length > 0 && args[0].startsWith("