Skip to content

Commit

Permalink
Made the '-a' flag accept language names with special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
ZapAnton committed Nov 4, 2019
1 parent 46e70b3 commit 13928fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ pub enum Language {
C,
Clojure,
CoffeeScript,
#[strum(serialize = "c++")]
Cpp,
#[strum(serialize = "c#")]
Csharp,
CSS,
Dart,
Expand All @@ -31,6 +33,7 @@ pub enum Language {
Lisp,
Lua,
Nim,
#[strum(serialize = "objective-c")]
ObjectiveC,
Perl,
Php,
Expand Down Expand Up @@ -60,8 +63,8 @@ impl std::fmt::Display for Language {
Language::C => write!(f, "C"),
Language::Clojure => write!(f, "Clojure"),
Language::CoffeeScript => write!(f, "CoffeeScript"),
Language::Cpp => write!(f, "Cpp"),
Language::Csharp => write!(f, "Csharp"),
Language::Cpp => write!(f, "C++"),
Language::Csharp => write!(f, "C#"),
Language::CSS => write!(f, "CSS"),
Language::Dart => write!(f, "Dart"),
Language::Elixir => write!(f, "Elixir"),
Expand All @@ -80,7 +83,7 @@ impl std::fmt::Display for Language {
Language::Lisp => write!(f, "Lisp"),
Language::Lua => write!(f, "Lua"),
Language::Nim => write!(f, "Nim"),
Language::ObjectiveC => write!(f, "ObjectiveC"),
Language::ObjectiveC => write!(f, "Objective-C"),
Language::PureScript => write!(f, "PureScript"),
Language::Python => write!(f, "Python"),
Language::R => write!(f, "R"),
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ fn main() -> Result<()> {
.short("a")
.long("ascii_language")
.takes_value(true)
.default_value("")
.default_value("rust")
.possible_values(
&possible_languages
.iter()
.map(|l| l.as_str())
.collect::<Vec<&str>>(),
)
.case_insensitive(true)
.help("Overrides showing the dominant language ascii logo."),
)
.arg(
Expand Down

0 comments on commit 13928fa

Please sign in to comment.