-
Notifications
You must be signed in to change notification settings - Fork 1
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 add a new syntax that can be used in custom slash commands to provide default values for arguments.
An argument with a default value: ${2:foobar}
Above is an example of a slash command containing an argument with the default value. If the value of the second argument is not an empty string (or a string consisting solely of whitespace), its value is used; otherwise, the value foobar is used.
This feature should build upon the work done in the refactor/shared-substitute branch and be integrated into the shared substitution function added by the aforementioned branch.
This feature should be independent of, but fully compatible with the following branch's features: feat/argument-range-syntax and feat/opencode-expand: the feature should work properly if these branches are not also merged, but if they are also merged then it should work in conjunction with them as well: it should be possible to use this in files processed by an opencode expand command (if also merged) or in conjunction with the argument range syntax (if also merged, examples: ${2..3:foo bar baz}, ${3..:a default string}, ${..:another default string}).