Skip to content

Commit 5651f68

Browse files
committed
Tweak commandline and add README.md content
1 parent 9ab3231 commit 5651f68

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

Cargo.toml

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ xml_dom = "0.2"
1212
unicode-bom = "2.0"
1313
clap = { version = "4.3.19", features = ["derive"] }
1414

15+
[profile.release]
16+
opt-level = 'z' # Optimize for size.
17+
lto = true
18+
panic = 'abort'
19+
codegen-units = 1
20+
1521
[[bin]]
1622
name = "docxtools"
1723
path = "src/bin/main.rs"

README.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,29 @@
1-
# docxtools
1+
# docxtools
2+
3+
A command-line utility to work with docx files. Can be useful for unix stream-based operations
4+
such as searching through a large amount of docx files on the commandline. It can also be
5+
useful for batch operations.
6+
7+
`docxtools` is written in Rust, platform-specific binary downloads can be found in the Release area.
8+
9+
## Usage
10+
11+
General usage:
12+
13+
```
14+
$ ./docxtools -h
15+
Usage: docxtools [OPTIONS] <IN_FILE> <COMMAND>
16+
17+
Commands:
18+
cat List the text from the document to the console
19+
grep Search the text in the document like 'grep'
20+
help Print this message or the help of the given subcommand(s)
21+
22+
Arguments:
23+
<IN_FILE> The docx file to operate on
24+
25+
Options:
26+
-t, --temp-dir <TEMP_DIR> The temporary directory to use. If not specified a system temp directory will be used and cleaned after use
27+
-h, --help Print help
28+
-V, --version Print version
29+
```

src/bin/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use docxtools::zip_util::ZipUtil;
99
#[command(propagate_version = true)]
1010
struct Cli {
1111
/// The docx file to operate on.
12-
#[arg(short, long)]
1312
in_file: String,
1413

1514
/// The temporary directory to use. If not specified a system temp directory
@@ -36,6 +35,7 @@ struct CatArgs {
3635

3736
#[derive(Args)]
3837
struct GrepArgs {
38+
/// The regular expression to search for
3939
regex: String,
4040
}
4141

0 commit comments

Comments
 (0)