This repository has been archived on 2020-06-12. You can view files and clone it, but cannot push or open issues/pull-requests.
town-launcher/README.md

51 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2020-06-08 17:22:38 +00:00
This is an implementation of an idea we discussed a while ago; a launcher for town-specific
commands.
2020-06-08 16:02:27 +00:00
2020-06-08 17:22:38 +00:00
The idea is to put town commands in one of three places:
2020-06-08 22:14:50 +00:00
- /town/launcher/core
- /town/launcher/contrib
- /town/launcher/admin
2020-06-08 17:22:38 +00:00
and pair each command with a corresponding .yml file.
For example, the `aup` command is a simple wrapper around elinks that opens our code of conduct. I
put the executable `aup` in /town/launcher/core and matched it with /town/launcher/aup.yml. The
purpose of the yaml file is to provide documentation for your executable, so `aup.yml` looks like:
2020-06-08 22:14:50 +00:00
```yaml
shortDesc: View the town's Acceptable Use Policy
longDesc: |
This command will open our code of conduct, a type of document that evokes the Acceptable Use
Policies that governed servers like this in the past. It will open the elinks browser to a
page on the wiki.
examples: |
$ town aup # open the aup
$ town aup --rainbow # open the aup with rainbow colors
maintainer: vilmibm
2020-06-08 22:14:50 +00:00
```
2020-06-08 17:22:38 +00:00
and using the launcher is like:
$ town aup
$ town aup --rainbow
2020-06-10 05:35:34 +00:00
$ town writo
2020-06-08 17:22:38 +00:00
$ town admin ban vilmibm
You can see all the commands with `town help` as well as their descriptions; `town help
aup` would show you the docs from `aup.yml`.
I'd love feedback on this approach while I wrap up this implementation. I can put it up on
git.tilde.town if anyone desires to collaborate (and let me know if you want a git.tilde.town
account).
Remaining TODOs:
- [ ] make tab completion available for common shells
- [ ] document / script submitting a tool for inclusion in contrib
2020-06-12 21:44:32 +00:00
- [x] make little wrappers for things like `mail` and `chat`
2020-06-10 05:35:34 +00:00
- [x] fix arg passing
- [x] test with a command that makes use of stdin/stdout
- [x] add all existing commands to the buckets
- [x] add to users' paths