- Description:
This key defines a parser configuration that parses a single argument, optionally delimited by characters.
Useful for matching a single positional argument.
The argument parser is also used to parse a list of repeating arguments.
- Appears in:
└── Snippet └── params └── * └── Argument Parser Configuration- Type:
Object- Properties:
This key defines configuration options for argument parser configurations.
The value is an object that can contain
modelandformatproperties. These options control how a single argument value is parsed and validated.Show examplesHide examples
In this example, we have configured argument parser options with a model and format.
Copied to clipboard_snippets: example: snippet: <<example [[param]]>> params: param: parser: argument options: model: editor_key: example_id format: string_boundary: - '"'{ "_snippets": { "example": { "snippet": "<<example [[param]]>>", "params": { "param": { "parser": "argument", "options": { "model": { "editor_key": "example_id" }, "format": { "string_boundary": [ "\"" ] } } } } } } }This key defines the parser type for argument parser configurations.
The value must be
argument. This specifies that the parameter uses the argument parser, which parses a single argument value.Show examplesHide examples
In this example, we have configured an argument parser for a snippet parameter.
Copied to clipboard_snippets: example: snippet: <<example [[param]]>> params: param: parser: argument options: model: editor_key: example_id{ "_snippets": { "example": { "snippet": "<<example [[param]]>>", "params": { "param": { "parser": "argument", "options": { "model": { "editor_key": "example_id" } } } } } } }- Examples:
In this example, we have configured an argument parser to parse a single positional argument.
MarkdownCopied to clipboard{{<figure image.png>}} └───────┘In this example, we have configured an argument parser to parse a list of repeating arguments.
MarkdownCopied to clipboard{{<images image1.png image2.png image3.png>}} └──────────────────────────────┘