williamspiro / hubXml

A tool to turn any blog into a HubSpot importable XML file
MIT License
14 stars 5 forks source link

Use arguments for selectors #29

Open williamspiro opened 6 years ago

williamspiro commented 6 years ago
       <!-- https://mvnrepository.com/artifact/commons-cli/commons-cli -->
        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
            <version>1.4</version>
        </dependency>
        // CTR + ALT + R
        Options options = new Options();
        Option title = new Option("t", "title", true, "title selector");
        title.setRequired(true);
        options.addOption(title);
        CommandLineParser parser = new DefaultParser();
        try {
            // parse the command line arguments
            CommandLine line = parser.parse(options, args);
            // access with line.getOptionValue("t")
        } catch (ParseException exp) {
            // oops, something went wrong
            System.err.println("Parsing failed.  Reason: " + exp.getMessage());
        }
williamspiro commented 5 years ago

I have been thinking about this one for a long time. I actually think I have so many inputs that this would make running this locally a bit of a pain right now. Here is my thought:

Build an API and keep a development version which still had the selectors file. 🦐 not sure, but will think about this more, it is just annoying to have so many arguments when running locally