summaryrefslogtreecommitdiffstats
path: root/tool/make-usage.sh
diff options
context:
space:
mode:
authorJustus Winter <justus@pep-project.org>2017-12-21 16:31:44 +0100
committerJustus Winter <justus@pep-project.org>2017-12-21 18:02:35 +0100
commitb6fae6ab962f0061f18158d04c4ef6a7d06498cf (patch)
tree3702a1234e4e25e06f682681c7ea799ef49131eb /tool/make-usage.sh
parentf2e693585e65d8c4873f5bbef8fd32c93e7a2d9e (diff)
tool: New crate.
- A command line tool to interact with Sequoia. Useful for debugging and development.
Diffstat (limited to 'tool/make-usage.sh')
-rw-r--r--tool/make-usage.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/tool/make-usage.sh b/tool/make-usage.sh
new file mode 100644
index 00000000..bc150a75
--- /dev/null
+++ b/tool/make-usage.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+quote() {
+ sed 's@^@//! @' | sed 's/ $//'
+}
+
+begin_code() {
+ printf '```text\n'
+}
+
+end_code() {
+ printf '```\n'
+}
+
+(
+ printf "A command-line frontend for Sequoia.
+
+# Usage
+
+"
+ begin_code
+ sq --help
+ end_code
+
+ sq --help |
+ sed -n '/^SUBCOMMANDS:/,$p' |
+ tail -n+2 |
+ while read command desc
+ do
+ if [ "$command" = help ]; then
+ continue
+ fi
+
+ printf "\n## Subcommand $command\n\n"
+ begin_code
+ sq $command --help
+ end_code
+ done
+) | quote
+
+printf '\ninclude!("main.rs");\n'