001/************************* PROJECT RON *************************/ 002/* Copyright (c) 2026 StuyPulse Robotics. All rights reserved. */ 003/* Use of this source code is governed by an MIT-style license */ 004/* that can be found in the repository LICENSE file. */ 005/***************************************************************/ 006package tools.PathplannerSearch; 007 008import java.io.IOException; 009import tools.PathplannerSearch.PathplannerSearch.SearchType; 010import tools.ToolClasses.ArgumentEnum; 011 012/** 013 * 014 * 015 * <h2>Main class for PathplannerSearch</h2> 016 * 017 * <p> 018 * To use, run: 019 * 020 * <pre> 021 * ./gradlew runPathplannerSearch -Pargs="[search term] [search type]" 022 * </pre> 023 * 024 * <p> 025 * <b>Example:</b> 026 * 027 * <pre> 028 * ./gradlew runPathplannerSearch -Pargs="disruptAUton path" 029 * </pre> 030 * 031 * If your search term has spaces, then wrap it in quotes: 032 * 033 * <p> 034 * <b>Example:</b> 035 * 036 * <pre> 037 * ./gradlew runPathplannerSearch -Pargs="'Disrupt Auton Thing' path" 038 * </pre> 039 * 040 * <p> 041 * <b>Arguments:</b> 042 * 043 * <ul> 044 * <li><b>[search term]</b>: The term to search for in the Pathplanner files. 045 * <li><b>[search type]</b>: The type of search to perform: 046 * <ul> 047 * <li>{@code linked_waypoint} 048 * <li>{@code path} 049 * </ul> 050 * </ul> 051 */ 052public class Main { 053 public enum ARGUMENTS implements ArgumentEnum { 054 SEARCH_TERM(String.class, "", "The term to search for in the Pathplanner files"), 055 SEARCH_TYPE(SearchType.class, SearchType.PATH, "The type of search to perform."); 056 057 private final Class<?> argumentType; 058 private final Object defaultValue; 059 private final String description; 060 061 ARGUMENTS(Class<?> argumentType, Object defaultValue, String description) { 062 this.argumentType = argumentType; 063 this.defaultValue = defaultValue; 064 this.description = description; 065 } 066 067 @Override 068 public Class<?> getArgumentType() { 069 return argumentType; 070 } 071 072 @Override 073 public Object getDefaultValue() { 074 return defaultValue; 075 } 076 077 @Override 078 public String getDescription() { 079 return description; 080 } 081 } 082 083 public static void main(String[] args) throws IOException { 084 new PathplannerSearch().run(args[0]); 085 } 086}