Skip to content

Commit

Permalink
doc: added spec examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed May 10, 2022
1 parent bec2f56 commit f8f18b0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Bridge](./bridge.md)
- [Style](./style.md)
- [Specs](./specs.md)
- [Examples](./specs/examples.md)
- [Macros](./specs/macros.md)
- [Development](./development.md)
- [Build](./development/build.md)
Expand Down
36 changes: 36 additions & 0 deletions docs/src/specs/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Examples

## github.yaml

```yaml
name: github
completion:
positional:
- ["$_tools.gh.OwnerRepositories"] # ${C_ARG0}
- ["$_tools.git.LsRemoteRefs({url: 'https://github.com/${C_ARG0}', branches: true, tags: true})"]
```
## zipfile.yaml
```yaml
name: zipfile
completion:
positional:
- ["$files([.zip])"] # ${C_ARG0}
positionalany: ["$_fs.ZipFileContents(${C_ARG0})"] # ${C_ARG1},${C_ARG2},...
```
## refs.yaml
```yaml
name: refs
flags:
-t, --tags: include tags # ${C_FLAG_TAGS}
--localbranches: include local branches # ${C_FLAG_LOCALBRANCHES}
--c=: amount of commits # ${C_FLAG_C}
completion:
positional:
- ["$_tools.git.Refs({tags: ${C_FLAG_TAGS:-false}, localbranches: ${C_FLAG_LOCALBRANCHES:-false}, commits: ${C_FLAG_C:-0}})"]
- ["$_tools.git.Refs"]
- ["$(env)"]
```

0 comments on commit f8f18b0

Please sign in to comment.