Skip to content

Commit 3c92cf6

Browse files
committed
Update README with new functionality
1 parent de131ac commit 3c92cf6

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,19 @@ function meta_create_balloon() {
7171
[],
7272
[],
7373
["normal", "animal_dog", "animal_snake"],
74-
["pink", "blue", "brown", "green"]
74+
function() {
75+
var _colors = [];
76+
// some code that fetches a dynamic list of available colors here
77+
return _colors;
78+
}
7579
],
7680
argumentDescriptions: [
7781
"the X coordinate to create the balloon at",
7882
"the Y coordinate to create the balloon at",
7983
"the type of balloon to create",
8084
"the color of the balloon"
81-
]
85+
],
86+
hidden: false
8287
}
8388
}
8489
```
@@ -97,7 +102,9 @@ Some things to keep in mind:
97102
1. The function names must match after the `sh_` and `meta_` prefixes.
98103
2. The order of the array items in `arguments`, `suggestions`, and `argumentDescriptions` must line up
99104
3. If suggestions aren't needed for an argument (like for `x` or `y` above), just input a blank array `[]`
100-
4. `description` and `argumentDescriptions` are optional, they're only used for the `help` output
105+
4. Each of the items inside `suggestions` can be either a static array of possible suggestions, or a function that returns an array. If you use a function, it will be called at run-time, making the suggestions dynamic!
106+
5. `description` and `argumentDescriptions` are optional, they're only used for the `help` output
107+
6. `hidden` is optional, but if `hidden` is set to `true`, the function will not appear in the help output, or in autocomplete suggestions! This way you can add secret cheat codes. You will still be able to type `help hidden_function_name` and see help output, but only if you know that hidden function's name in the first place.
101108

102109
## Keyboard Shortcuts
103110

@@ -112,6 +119,7 @@ In the shell, there are a number of useful keyboard shortcuts. These are all tri
112119
| Meta-key + Backspace | Delete from the cursor backwards to the preceding space |
113120
| Meta-key + K | Delete forward from the cursor to the end of the line, and store the deleted text on a clipboard (this is equivalent to GNU-style "kill", but our clipboard only stores one thing rather than a ring) |
114121
| Meta-key + Y | Insert previously "killed" text at the cursor position (this is equivalent to GNU-style "yank", but our clipboard only stores one thing rather than a ring ) |
122+
| Meta-key + C | Abort the current command. This will put the aborted command into the output history, but not execute it, and will return your shell to a blank input |
115123

116124
## Configuring rt-shell
117125

0 commit comments

Comments
 (0)