invalid-command-line
- Type: error
- Kind:
usage(the caller misused the API)
What happened
The command line didn’t parse: a command or flag laminapdf doesn’t have, a missing argument, a value of the wrong form, or - (standard input) named as more than one input.
Why
The CLI checks its whole command line before it reads any file, so a typo never runs half a command. Exit code 2 tells a script that the call itself was wrong, not the document.
How to fix
Run the command with --help to see its arguments, and laminapdf --help for the commands. Read standard input at most once per command.
Example
$ laminapdf info --pages 1 report.pdferror[invalid-command-line]: unexpected argument '--pages' found
Usage: laminapdf info [OPTIONS] <INPUT>
For more information, try '--help'.$ echo $?2With --json, the line on standard error has the message “the command line doesn’t parse” and the parser’s finding in data.detail.
Data fields
Which field is there depends on what was wrong:
detail: when the parser refused the line, the kind of problem it found, such asUnknownArgumentorMissingRequiredArgument.argument: when a value parsed but means nothing, the value given: the angle ofpages rotate, ahelptopic or a--fieldskey (untrusted: caller text, never in the message).