-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-help.docs.sh
executable file
·161 lines (119 loc) · 4.52 KB
/
make-help.docs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/bin/bash
# This script generates the the following help documentation for ROVER:
# docs/configuration.md
# docs/commands.md
#
# The `rover` command is expected to be in the PATH, e.g. via
# a virtual environment where the rover package is installed.
# Change to the directory of the script
script_dir="$(dirname "$(readlink -f "$0")")"
cd "$script_dir"
cat <<EOF > docs/configuration.md
# ROVER Configuration
ROVER can be configured via a file, by using command line options,
or a combination of the two. Option names are the same in both cases.
## File Configuration
ROVER's configuration file, normally named rover.config, contains all
options for a ROVER repository. A default config is created when a
ROVER repository is initialized.
By default \`rover.config\` is searched for in the current working
directory, which allows for ROVER commands to be run without specifying
a config file.
To explicitly use a configuration file, the \`-f\` or \`--file\` option
followed by a path to the configuration file can be included when
calling ROVER, e.g.:
rover -f /PATH/TO/rover.config
Use a text editor to change option values in the rover.config file.
Lines starting with \`#\` are comments.
## Command Line Configuration
Options can be directly specified on the command line.
For example, the \`verbosity\` option could be assigned
when running ROVER:
rover --verbosity 6 ...
Boolean options follow different syntax when assigned through the
command prompt versus a config file. In the terminal,
boolean options are interperted as flags, which can be
negated by prefixing the option's name with \`no-\`:
rover --web ...
or
rover --no-web ...
Available options are displayed using \`rover -h\` or \`rover -H\`,
with the later syntax showing the full help with all options.
## Default Configuration
Upon initialization of a new repository, ROVER's default configuration
is written to a file named \`rover.config\`. ROVER repositories are
initialized by running the command:
rover init-repository /PATH/TO/DATAREPO
By default, a repository is arranged in the following structure:
DATAREPO/
+- rover.config
+- leap-seconds.list
+- logs/
| +- ...
+- data/
| +- timeseries.sqlite
| +- ...
+- tmp/
+- ...
All of these base directory and file locations can be specified
using ROVER options.
## Options
EOF
python -c 'from rover.args import Arguments; Arguments().print_docs_table_md()' >> docs/configuration.md
cat <<EOF > docs/commands.md
# ROVER Commands
* [Normal Usage](#normal-usage)
* [Init Repository](#init-repository)
* [Retrieve](#retrieve)
* [List Retrieve](#list-retrieve)
* [List Index](#list-index)
* [List Summary](#list-summary)
* [Low-Level Commands](#low-level-commands)
* [Download](#download)
* [Ingest](#ingest)
* [Index](#index)
* [Summary](#summary)
* [Web](#web)
* [Retrieve-Metadata](#Retrieve-Metadata)
## Common ROVER Commands
EOF
rover help init-repository --md-format >> docs/commands.md
rover help retrieve --md-format >> docs/commands.md
rover help list-retrieve --md-format >> docs/commands.md
rover help list-index --md-format >> docs/commands.md
rover help list-summary --md-format >> docs/commands.md
cat <<EOF >> docs/commands.md
## Low-Level Commands
The following commands are used internally, and are often less
useful from the command line:
EOF
rover help download --md-format >> docs/commands.md
rover help ingest --md-format >> docs/commands.md
rover help index --md-format >> docs/commands.md
rover help summary --md-format >> docs/commands.md
# rover help daemon --md-format >> docs/commands.md
rover help web --md-format >> docs/commands.md
rover help retrieve-metadata --md-format >> docs/commands.md
# Make lines associated with daemon mode invisible for only help docs.
# To reinstates daemon mode documentation move lines below to line 92
# * [Advanced Usage](#advanced-usage)
# * [Subscribe](#subscribe)
# * [Daemon](#daemon)
# * [Start](#start)
# * [Stop](#stop)
# * [Status](#status)
# * [Unsubscribe](#unsubscribe)
# * [Trigger](#trigger)
# To reinstates daemon mode documentation move lines below to line 110
# ## Advanced ROVER Commands
#
# EOF
#
# rover help subscribe --md-format >> docs/commands.md
# rover help start --md-format >> docs/commands.md
# rover help stop --md-format >> docs/commands.md
# rover help status --md-format >> docs/commands.md
# rover help unsubscribe --md-format >> docs/commands.md
# rover help trigger --md-format >> docs/commands.md
#
# cat <<EOF >> docs/commands.md