Skip to content

Commit d68c62f

Browse files
committed
complete first help doc draft
1 parent d5026e0 commit d68c62f

File tree

2 files changed

+117
-1
lines changed

2 files changed

+117
-1
lines changed

lib/bashly/docs/command.yml

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ command.catch_all:
5151
- name: download
5252
help: Download one or more URLs
5353
54-
# Set to true to simply enable this option
54+
# Set to 'true' to simply enable this option
5555
catch_all: true
5656
5757
- name: upload
@@ -149,6 +149,82 @@ command.examples:
149149
Upload a file (you will be prompted to provide a password)
150150
$ cli upload profile.png --user admin
151151
152+
command.expose:
153+
help: Specify that the sub-commands of this command should be visible when showing the usage of its parent.
154+
url: https://bashly.dannyb.co/configuration/command/#expose
155+
example: |-
156+
name: cli
157+
commands:
158+
- name: config
159+
help: Config management commands
160+
161+
# Set to 'true' to show both 'config edit' and 'config show' when
162+
# running 'cli --help'
163+
expose: true
164+
commands:
165+
- name: edit
166+
help: Edit config file
167+
- name: show
168+
help: Show config file
169+
170+
- name: server
171+
help: Server management commands
172+
173+
# Set to 'always' to also show the usage of the sub-commands when
174+
# running 'cli' without arguments.
175+
expose: always
176+
177+
commands:
178+
- name: start
179+
help: Start the server
180+
- name: stop
181+
help: Stop the server
182+
183+
command.extensible:
184+
help: Specify that this command can be extended by external means.
185+
url: https://bashly.dannyb.co/configuration/command/#extensible
186+
example: |-
187+
name: mygit
188+
help: Wrapper for git
189+
version: 0.1.0
190+
191+
# Set to 'true' to allow extending it by creating executables in the
192+
# path named 'mygit-*'.
193+
extensible: true
194+
195+
# Set to another executable name to delegate all unknown commands
196+
# to it.
197+
extensible: git
198+
199+
command.filename:
200+
help: Specify the path (relative to src) to the partial source code file.
201+
url: https://bashly.dannyb.co/configuration/command/#filename
202+
example: |-
203+
commands:
204+
- name: connect
205+
help: Connect to server
206+
filename: admin_commands/list.sh
207+
208+
command.filters:
209+
help: Specify a list of custom filter functions that will prevent the command from running unless certain conditions are met.
210+
url: https://bashly.dannyb.co/configuration/command/#filters
211+
example: |-
212+
commands:
213+
- name: container
214+
help: Perform actions on a docker container
215+
216+
# When the command is executed, your script will look for a function
217+
# named 'filter_docker_running' and execute it. If it prints a string,
218+
# it will be considered an error and the command execution will be
219+
# halted.
220+
filters:
221+
- docker_running
222+
223+
# Example function (put somewhere in src/lib)
224+
filter_docker_running() {
225+
docker info >/dev/null 2>&1 || echo "Docker must be running"
226+
}
227+
152228
command.flags:
153229
help: Define a list of option flags. See `flag` for reference.
154230
url: https://bashly.dannyb.co/configuration/command/#flags
@@ -164,6 +240,27 @@ command.footer:
164240
example: |-
165241
footer: For further help visit https://my.docs-site.com
166242
243+
command.function:
244+
help: Specify a different base function name for this command.
245+
url: https://bashly.dannyb.co/configuration/command/#function
246+
example: |-
247+
commands:
248+
- name: container-start
249+
help: Start a new container (deprecated)
250+
251+
# Override the name of the internal functions bashly uses. This is
252+
# needed in this case since the command 'container-start' and the
253+
# nested command 'container start' will have the same underlying
254+
# function name otherwise.
255+
function: deprecated_container_start
256+
footer: This command is deprecated, use 'container start' instead
257+
258+
- name: container
259+
help: Container commands
260+
commands:
261+
- name: start
262+
help: Start a new container
263+
167264
command.group:
168265
help: Specify the group that this command belongs to.
169266
url: https://bashly.dannyb.co/configuration/command/#group
@@ -195,6 +292,15 @@ command.name:
195292
- name: images
196293
help: Manage images
197294
295+
command.private:
296+
help: Specify that this command should not be displayed in the help text.
297+
url: https://bashly.dannyb.co/configuration/command/#private
298+
example: |-
299+
commands:
300+
- name: completions
301+
help: Send bash completions
302+
private: true
303+
198304
command.version:
199305
help: Specify the version to show when running with `--version`.
200306
url: https://bashly.dannyb.co/configuration/command/#version

lib/bashly/docs/env.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ environment_variable.name:
3535
- name: api_key
3636
help: Your API key
3737
38+
environment_variable.private:
39+
help: Specify that this environment variable should not be advertised in the usage text. Only makes sense when accompanied by `default`.
40+
url: https://bashly.dannyb.co/configuration/environment-variable/#private
41+
example: |-
42+
environment_variables:
43+
- name: editor
44+
help: Editor to use
45+
default: vim
46+
private: true
47+
3848
environment_variable.required:
3949
help: Specify that this variable is required.
4050
url: https://bashly.dannyb.co/configuration/environment-variable/#required

0 commit comments

Comments
 (0)