Skip to content

Commit d74351d

Browse files
committed
small changes in #103
1 parent 1164959 commit d74351d

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/main.rs

+10-11
Original file line numberDiff line numberDiff line change
@@ -154,21 +154,20 @@ Possible values: [{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}]",
154154
)),
155155
)
156156
.arg(
157-
Arg::with_name("supported")
158-
.short("s")
159-
.long("supported")
160-
.help("Prints a list of all supported languages"),
157+
Arg::with_name("languages")
158+
.short("l")
159+
.long("languages")
160+
.help("Prints out supported languages"),
161161
)
162162
.get_matches();
163163

164-
if matches.is_present("supported") {
165-
let list = Language::iter()
166-
.filter(|x| *x != Language::Unknown)
167-
.map(|x| x.to_string().color(x.get_colors()[0]).to_string())
168-
.collect::<Vec<String>>()
169-
.join(", ");
164+
if matches.is_present("languages") {
165+
let iterator = Language::iter()
166+
.filter(|x| *x != Language::Unknown);
170167

171-
print!("Supported languages:\n\n{}\n", list);
168+
for l in iterator {
169+
println!("{}", l);
170+
}
172171
std::process::exit(0);
173172
}
174173

0 commit comments

Comments
 (0)