0
@Parameters(paramLabel = "AMOUNT", description = "the depth to scrape for")
private int amount;

@Parameters(paramLabel = "ENTRY_POINT", description = "the entry point for the scrape")
private String entryPoint;

I have these Parameters in my Main class. When I run the program with ClassName 5 https://www.baeldung.com/ I get

Missing required parameters: 'AMOUNT', 'ENTRY_POINT'
Usage: <main class> AMOUNT ENTRY_POINT
      AMOUNT        the depth to scrape for
      ENTRY_POINT   the entry point for the scrape

Does anyone know why this happens?

I can provide more code if needed.

0xff
  • 181
  • 2
  • 11
  • 1
    This is where a [mcve] is useful. No-one could have answered your question without basically *guessing* what you'd done... whereas if you'd written out a minimal example, you may well have found the problem before even asking the question. – Jon Skeet Jan 20 '22 at 18:42

1 Answers1

1

Resolved; I didn't pass the arguments from the command-line in my main-mathod ...

Pretty stupid lol.

Before, not working

public static void main(String[] args) {
    var cmd = new CommandLine(new Scraper());
    cmd.execute();
}

After, working

public static void main(String[] args) {
    var cmd = new CommandLine(new Scraper());
    cmd.execute(args);
}
0xff
  • 181
  • 2
  • 11