+ case SEARCH:
+ if (searchOn == null) {
+ searchOn = SupportType.valueOfAllOkUC(args[i]);
+
+ if (searchOn == null) {
+ Instance.getTraceHandler().error(
+ "Website not known: <" + args[i] + ">");
+ exitCode = 255;
+ }
+
+ if (BasicSearchable.getSearchable(searchOn) == null) {
+ Instance.getTraceHandler().error(
+ "Website not supported: " + searchOn);
+ exitCode = 255;
+ }
+ } else if (search == null) {
+ search = args[i];
+ } else if (page == null) {
+ try {
+ page = Integer.parseInt(args[i]);
+ } catch (NumberFormatException e) {
+ Instance.getTraceHandler().error(
+ new Exception("Incorrect page number: <"
+ + args[i] + ">", e));
+ exitCode = 255;
+ }
+ } else if (item == null) {
+ try {
+ item = Integer.parseInt(args[i]);
+ } catch (NumberFormatException e) {
+ Instance.getTraceHandler().error(
+ new Exception("Incorrect item number: <"
+ + args[i] + ">", e));
+ exitCode = 255;
+ }
+ } else {
+ exitCode = 255;
+ }
+ break;
+ case SEARCH_TAG:
+ if (searchOn == null) {
+ searchOn = SupportType.valueOfAllOkUC(args[i]);
+
+ if (searchOn == null) {
+ Instance.getTraceHandler().error(
+ "Website not known: <" + args[i] + ">");
+ exitCode = 255;
+ }
+
+ if (BasicSearchable.getSearchable(searchOn) == null) {
+ Instance.getTraceHandler().error(
+ "Website not supported: " + searchOn);
+ exitCode = 255;
+ }
+ } else {
+ tags.add(args[i]);
+ }
+ break;