File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ xml_dom = "0.2"
1212unicode-bom = " 2.0"
1313clap = { 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 ]]
1622name = " docxtools"
1723path = " src/bin/main.rs"
Original file line number Diff line number Diff line change 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+ ```
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ use docxtools::zip_util::ZipUtil;
99#[ command( propagate_version = true ) ]
1010struct 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 ) ]
3837struct GrepArgs {
38+ /// The regular expression to search for
3939 regex : String ,
4040}
4141
You can’t perform that action at this time.
0 commit comments