mirror of
https://github.com/XAMPPRocky/tokei
synced 2024-08-29 04:09:23 +00:00
changed formatting
This commit is contained in:
parent
f33c615f15
commit
8d7496905b
10
Cargo.lock
generated
10
Cargo.lock
generated
|
@ -1,8 +1,8 @@
|
||||||
[root]
|
[root]
|
||||||
name = "tokei"
|
name = "tokei"
|
||||||
version = "1.3.1"
|
version = "1.4.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clap 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"glob 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"glob 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"maplit 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"maplit 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"walkdir 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"walkdir 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -10,7 +10,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ansi_term"
|
name = "ansi_term"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -20,10 +20,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "2.0.1"
|
version = "2.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"strsim 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"strsim 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"vec_map 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"vec_map 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -96,7 +96,7 @@ impl<'a> fmt::Display for Language<'a> {
|
||||||
self.total
|
self.total
|
||||||
};
|
};
|
||||||
write!(f,
|
write!(f,
|
||||||
" {: <10} {: >10} {:>10} {:>10} {:>10} {:>10}",
|
" {: <12} {: >12} {:>12} {:>12} {:>12} {:>12}",
|
||||||
self.name,
|
self.name,
|
||||||
total,
|
total,
|
||||||
self.lines,
|
self.lines,
|
||||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -26,7 +26,7 @@ use language::Language;
|
||||||
|
|
||||||
use fsutil::contains_comments;
|
use fsutil::contains_comments;
|
||||||
const ROW: &'static str = "-----------------------------------------------------------------------\
|
const ROW: &'static str = "-----------------------------------------------------------------------\
|
||||||
---------";
|
--------";
|
||||||
const BLANKS: &'static str = "blanks";
|
const BLANKS: &'static str = "blanks";
|
||||||
const COMMENTS: &'static str = "comments";
|
const COMMENTS: &'static str = "comments";
|
||||||
const CODE: &'static str = "code";
|
const CODE: &'static str = "code";
|
||||||
|
@ -90,7 +90,7 @@ fn main() {
|
||||||
let yaml = Language::new_single("YAML", "#");
|
let yaml = Language::new_single("YAML", "#");
|
||||||
|
|
||||||
// Languages are placed inside a BTreeMap, in order to print alphabetically by default
|
// Languages are placed inside a BTreeMap, in order to print alphabetically by default
|
||||||
let mut languages = btreemap! {
|
let languages = btreemap! {
|
||||||
"as" => &action_script,
|
"as" => &action_script,
|
||||||
"bat" => &batch,
|
"bat" => &batch,
|
||||||
"btm" => &batch,
|
"btm" => &batch,
|
||||||
|
@ -201,7 +201,7 @@ fn main() {
|
||||||
let sort_empty = sort.is_empty();
|
let sort_empty = sort.is_empty();
|
||||||
|
|
||||||
println!("{}", ROW);
|
println!("{}", ROW);
|
||||||
println!(" {:<10} {:>10} {:>10} {:>10} {:>10} {:>10}",
|
println!(" {:<12} {:>12} {:>12} {:>12} {:>12} {:>12}",
|
||||||
"Language",
|
"Language",
|
||||||
"Files",
|
"Files",
|
||||||
"Total",
|
"Total",
|
||||||
|
@ -219,7 +219,7 @@ fn main() {
|
||||||
let extension = unwrap_opt_cont!(unwrap_opt_cont!(path.extension())
|
let extension = unwrap_opt_cont!(unwrap_opt_cont!(path.extension())
|
||||||
.to_str());
|
.to_str());
|
||||||
let lowercase = extension.to_lowercase();
|
let lowercase = extension.to_lowercase();
|
||||||
unwrap_opt_cont!(languages.get_mut(&*lowercase))
|
unwrap_opt_cont!(languages.get(&*lowercase))
|
||||||
};
|
};
|
||||||
|
|
||||||
language.borrow_mut().files.push(path);
|
language.borrow_mut().files.push(path);
|
||||||
|
@ -244,7 +244,7 @@ fn main() {
|
||||||
let extension = unwrap_opt_cont!(unwrap_opt_cont!(entry.path().extension())
|
let extension = unwrap_opt_cont!(unwrap_opt_cont!(entry.path().extension())
|
||||||
.to_str());
|
.to_str());
|
||||||
let lowercase = extension.to_lowercase();
|
let lowercase = extension.to_lowercase();
|
||||||
unwrap_opt_cont!(languages.get_mut(&*lowercase))
|
unwrap_opt_cont!(languages.get(&*lowercase))
|
||||||
};
|
};
|
||||||
|
|
||||||
language.borrow_mut().files.push(entry.path().to_owned());
|
language.borrow_mut().files.push(entry.path().to_owned());
|
||||||
|
@ -253,7 +253,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut total = Language::new_raw("Total");
|
let mut total = Language::new_raw("Total");
|
||||||
for (_, language) in &mut languages {
|
for (_, language) in &languages {
|
||||||
|
|
||||||
if language.borrow().printed {
|
if language.borrow().printed {
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue