-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Let's extend the syntax that can be used to access positional arguments in custom slash commands' Markdown files.
Let's add a new syntax where the index of the positional argument can be surrounded by curly braces.
Optionally two indices may be provided, separated or separated by a colon... this describes a 'slice' over a range of the arguments. Either of the two indices may be omitted, leaving the range open to extend to the start or end of the array of available arguments.
Empty arguments will be skipped, and the contents of the non-empty arguments in the range will be joined together by spaces.
Examples follow:
${1} // equivalent to existing $1 syntax
Example: /command foo bar baz corge grault => 'foo'
${2} // equivalent to $2 syntax
Example: /command foo bar baz corge grault => 'bar'
${2:3} // 2nd and 3rd arguments (non-empty arguments joined by spaces)
Example: /command foo bar baz corge grault => 'bar baz'
Example: /command foo bar baz corge grault => 'bar baz'
Example: /command foo bar => 'bar'
${:3} // 1st through 3rd arguments, (non-empty arguments joined by spaces)
Example: /command foo bar baz corge grault => 'foo bar baz'
Example: /command foo bar => 'foo bar'
${2:} // 2nd through last arguments, (non-empty arguments joined by spaces)
Example: /command foo bar baz corge grault => 'bar baz corge grault'
Example: /command foo => ''
${:} // All arguments, (non-empty arguments joined by spaces)
Example: /command foo bar baz corge grault => 'foo bar baz corge grault'
Example: /command foo bar baz corge grault => 'foo bar baz corge grault'