You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib.rs
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
//! XCompress is a free file archiver utility on Linux, providing multi-format archiving to and extracting from ZIP, Z, GZIP, BZIP2, LZ, XZ, LZMA, 7ZIP, TAR, RAR ans ZSTD.
3
3
4
4
externcrate clap;
5
+
externcrate terminal_size;
5
6
externcrate num_cpus;
6
7
externcrate subprocess;
7
8
externcrate byte_unit;
@@ -11,11 +12,13 @@ use std::io::{ErrorKind, Read, BufReader, BufWriter, Write};
11
12
use std::path::{Path,PathBuf};
12
13
use std::env;
13
14
use std::fs;
15
+
14
16
use byte_unit::*;
15
17
use path_absolutize::Absolutize;
16
18
17
19
use subprocess::{Exec,ExitStatus,PopenError,Pipeline,NullFile};
18
20
21
+
use terminal_size::{Width, terminal_size};
19
22
use clap::{App,Arg,SubCommand};
20
23
21
24
// TODO -----Config START-----
@@ -142,7 +145,14 @@ impl Config {
142
145
"x -p password foo.rar # Extracts foo.rar with a password into current working directory"
143
146
];
144
147
148
+
let terminal_width = ifletSome((Width(width), _)) = terminal_size(){
149
+
width asusize
150
+
}else{
151
+
0
152
+
};
153
+
145
154
let matches = App::new(APP_NAME)
155
+
.set_term_width(terminal_width)
146
156
.version(CARGO_PKG_VERSION)
147
157
.author(CARGO_PKG_AUTHORS)
148
158
.about(format!("XCompress is a free file archiver utility on Linux, providing multi-format archiving to and extracting from ZIP, Z, GZIP, BZIP2, LZ, XZ, LZMA, 7ZIP, TAR and RAR.\n\nEXAMPLES:\n{}", examples.iter()
0 commit comments