You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,14 +71,19 @@ function meta_create_balloon() {
71
71
[],
72
72
[],
73
73
["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
+
}
75
79
],
76
80
argumentDescriptions: [
77
81
"the X coordinate to create the balloon at",
78
82
"the Y coordinate to create the balloon at",
79
83
"the type of balloon to create",
80
84
"the color of the balloon"
81
-
]
85
+
],
86
+
hidden: false
82
87
}
83
88
}
84
89
```
@@ -97,7 +102,9 @@ Some things to keep in mind:
97
102
1. The function names must match after the `sh_` and `meta_` prefixes.
98
103
2. The order of the array items in `arguments`, `suggestions`, and `argumentDescriptions` must line up
99
104
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.
101
108
102
109
## Keyboard Shortcuts
103
110
@@ -112,6 +119,7 @@ In the shell, there are a number of useful keyboard shortcuts. These are all tri
112
119
| Meta-key + Backspace | Delete from the cursor backwards to the preceding space |
113
120
| 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) |
114
121
| 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 |
0 commit comments