Add "random access" definition to ractool docs
diff --git a/cmd/ractool/data.go b/cmd/ractool/data.go
index 0e4ce76..9954b8f 100644
--- a/cmd/ractool/data.go
+++ b/cmd/ractool/data.go
@@ -16,7 +16,21 @@
package main
-const usageStr = `Usage:
+const usageStr = `ractool manipulates Random Access Compression (RAC) files.
+
+Random access means that it is possible to reconstruct part of the decompressed
+file, starting at a given offset into the decompressed file, without always
+having to first decompress all of the preceding data.
+
+In comparison to some other popular compression formats, all three of the Zlib,
+Brotli and Zstandard specifications (RFCs 1950, 7932 and 8478) explicitly
+contain the identical phrase: "the data format defined by this specification
+does not attempt to allow random access to compressed data".
+
+See the RAC specification for more details:
+https://github.com/google/wuffs/blob/master/doc/spec/rac-spec.md
+
+Usage:
ractool [flags] [input_filename]
diff --git a/cmd/ractool/gen.go b/cmd/ractool/gen.go
index fe9fd62..ba8ae20 100644
--- a/cmd/ractool/gen.go
+++ b/cmd/ractool/gen.go
@@ -41,13 +41,13 @@
return err
}
- if i := bytes.Index(src, []byte("Usage:\n\n")); i < 0 {
- return fmt.Errorf(`couldn't find "Usage" sub-string`)
+ if i := bytes.Index(src, []byte("ractool manipulates ")); i < 0 {
+ return fmt.Errorf(`couldn't find documentation sub-string`)
} else {
src = src[i:]
}
if j := bytes.Index(src, []byte("*/")); j < 0 {
- return fmt.Errorf(`couldn't find "Usage" sub-string`)
+ return fmt.Errorf(`couldn't find documentation sub-string`)
} else {
src = src[:j]
}
diff --git a/cmd/ractool/main.go b/cmd/ractool/main.go
index 44b0168..593ae2e 100644
--- a/cmd/ractool/main.go
+++ b/cmd/ractool/main.go
@@ -19,6 +19,15 @@
/*
ractool manipulates Random Access Compression (RAC) files.
+Random access means that it is possible to reconstruct part of the decompressed
+file, starting at a given offset into the decompressed file, without always
+having to first decompress all of the preceding data.
+
+In comparison to some other popular compression formats, all three of the Zlib,
+Brotli and Zstandard specifications (RFCs 1950, 7932 and 8478) explicitly
+contain the identical phrase: "the data format defined by this specification
+does not attempt to allow random access to compressed data".
+
See the RAC specification for more details:
https://github.com/google/wuffs/blob/master/doc/spec/rac-spec.md