feat: change commands to accept args

This commit is contained in:
2025-01-05 17:11:13 +01:00
parent ca729140c3
commit f1cc371294
2 changed files with 97 additions and 63 deletions

View File

@@ -74,16 +74,18 @@ local M = {
```yaml
commands:
- command: "list"
dir: "some/directory"
- command: "ls"
args: ["-l", "path/to/directory"]
- command: "grep"
pattern: "searchString"
target: "path/to/file/or/directory"
args: ["-r", "searchString", "path/to/file/or/directory"]
```
The "ls" command uses the system's 'ls' command to list directory contents.
When these commands are present and enable_debug_commands is true, I'll execute them and return the results in the clipboard.
The "ls" command uses the system's 'ls' command to list directory contents. You can pass flags or additional arguments in `args`.
The "grep" command searches for a given pattern in files or directories, again receiving flags or additional arguments in `args`.
If you omit `args` for grep, you can still use the older format with `pattern` and `target` for backward compatibility.
When these commands are present and `enable_debug_commands` is true, I'll execute them and return the results in the clipboard.
]]
}