Skip to content

Conversation

spoons-and-mirrors
Copy link
Contributor

@spoons-and-mirrors spoons-and-mirrors commented Aug 23, 2025

Summary

This PR adds powerful new argument handling capabilities for custom commands, making them more flexible for complex workflows.

New Features

Argument Patterns:

  • $ARGUMENTS[n] - Single argument at index n
  • $ARGUMENTS[n*] - All arguments from index n onwards
  • $ARGUMENTS[n+] - Arguments at index n and n+1
  • $ARGUMENTS[n++] - Arguments at index n, n+1, and n+2
  • $ARGUMENTS[n:m] - Range from index n to m

Example

With "/hello hello world foo bar baz . -y"

$ARGUMENTS[0] → "hello"
$ARGUMENTS[1*] → "world foo bar baz . -y"
$ARGUMENTS[2+] → "foo bar"
$ARGUMENTS[3++] → "bar baz ."
$ARGUMENTS[1:4] → "world foo bar baz"

The implementation handles out-of-bounds indices gracefully

- Add support for $ARGUMENTS[n] single index access
- Add support for $ARGUMENTS[n*] all-from-index pattern
- Add support for $ARGUMENTS[n+] adjacent arguments pattern
- Add support for $ARGUMENTS[n++] three-argument pattern
- Add support for $ARGUMENTS[n:m] range selection pattern
- Update command documentation with comprehensive examples
- Maintain backward compatibility with existing $ARGUMENTS usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant