Repository: google/argh (language: rust)

Issue:
Allow snake_case and kebab-case for `long` arg names
This should be allowed:

![image](https://user-images.githubusercontent.com/535593/86449859-0ab9c400-bd19-11ea-9065-860599e314ea.png)

Also underscore (snake_case) should be allowed in `long` names!

Maybe camelCase should be allowed, too.


Discussion / hints:
The theory behind this is one should prefer sub commands to using multiple words in a long flag. This might be too aggressive of a lint though.

If we do relax this though, I believe only kebab-case should be permitted.
Thanks, I'd be happy if only kebab case is allowed :)

It would be too strict to say "use subcommands here", because I already have many subcommands and they all have several long flags.
Tools like ffmpeg also have a lot of CLI flags that consist of multiple words.
I overcautiously put spec-change-required here, but I think we can do this before any actual spec change

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index e0d52fc..6687eb1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,17 +2,17 @@
 # It is not intended for manual editing.
 [[package]]
 name = "argh"
-version = "0.1.2"
+version = "0.1.3"
 dependencies = [
- "argh_derive 0.1.0",
- "argh_shared 0.1.0",
+ "argh_derive 0.1.1",
+ "argh_shared 0.1.1",
 ]
 
 [[package]]
 name = "argh_derive"
-version = "0.1.0"
+version = "0.1.1"
 dependencies = [
- "argh_shared 0.1.0",
+ "argh_shared 0.1.1",
  "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -21,7 +21,7 @@ dependencies = [
 
 [[package]]
 name = "argh_shared"
-version = "0.1.0"
+version = "0.1.1"
 
 [[package]]
 name = "heck"
diff --git a/argh_derive/src/parse_attrs.rs b/argh_derive/src/parse_attrs.rs
index 23a949b..3fb79de 100644
--- a/argh_derive/src/parse_attrs.rs
+++ b/argh_derive/src/parse_attrs.rs
@@ -161,7 +161,7 @@ impl FieldAttrs {
         if !value.is_ascii() {
             errors.err(long, "Long names must be ASCII");
         }
-        if !value.chars().all(|c| c.is_lowercase()) {
+        if !value.chars().all(|c| c.is_lowercase() || c == '-') {
             errors.err(long, "Long names must be lowercase");
         }
     }


Test patch: