File tree 3 files changed +36
-2
lines changed
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"
12
12
unicode-bom = " 2.0"
13
13
clap = { version = " 4.3.19" , features = [" derive" ] }
14
14
15
+ [profile .release ]
16
+ opt-level = ' z' # Optimize for size.
17
+ lto = true
18
+ panic = ' abort'
19
+ codegen-units = 1
20
+
15
21
[[bin ]]
16
22
name = " docxtools"
17
23
path = " 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;
9
9
#[ command( propagate_version = true ) ]
10
10
struct Cli {
11
11
/// The docx file to operate on.
12
- #[ arg( short, long) ]
13
12
in_file : String ,
14
13
15
14
/// The temporary directory to use. If not specified a system temp directory
@@ -36,6 +35,7 @@ struct CatArgs {
36
35
37
36
#[ derive( Args ) ]
38
37
struct GrepArgs {
38
+ /// The regular expression to search for
39
39
regex : String ,
40
40
}
41
41
You can’t perform that action at this time.
0 commit comments