Repository: taiki-e/cargo-hack (language: rust)

Issue:
Idea: emphasize ability to check multiple targets in documentation and help message
Like usual Cargo invocation, `cargo hack` can check multiple targets simultaneously if you specify multiple `--target` options.

This fact is however not very well known and is easy to miss; users may reach for cargo-hack to iterate targets, just like cargo-hack iterates features.

I suggest to add a reminder about this in README, also maybe mention `--target` explicitly in the CLI help message.


Discussion / hints:
I would accept PR that does this.

Fix patch:
diff --git a/README.md b/README.md
index bc62814..bc94d66 100644
--- a/README.md
+++ b/README.md
@@ -130,6 +130,14 @@ OPTIONS:
 
             This flag can only be used together with --feature-powerset flag.
 
+        --target <TRIPLE>
+            Build for specified target triple.
+
+            Comma-separated lists of targets are not supported, but you can specify the whole
+            --target option multiple times to do multiple targets.
+
+            This is actually not a cargo-hack option, it is interpreted by Cargo itself.
+
         --mutually-exclusive-features <FEATURES>...
             Space or comma separated list of features to not use together.
 
diff --git a/src/cli.rs b/src/cli.rs
index 0afb4e9..55365c1 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -733,6 +733,10 @@ const HELP: &[HelpText<'_>] = &[
          --group-features c,d`",
         "This flag can only be used together with --feature-powerset flag.",
     ]),
+    ("", "--target", "<TRIPLE>", "Build for specified target triple", &[
+        "Comma-separated lists of targets are not supported, but you can specify the whole --target option multiple times to do multiple targets.",
+        "This is actually not a cargo-hack option, it is interpreted by Cargo itself.",
+    ]),
     ("", "--mutually-exclusive-features", "<FEATURES>...", "Space or comma separated list of features to not use together", &[
         "To specify multiple groups, use this option multiple times: `--mutually-exclusive-features \
          a,b --mutually-exclusive-features c,d`",


Test patch:
diff --git a/tests/long-help.txt b/tests/long-help.txt
index cdcbace..53023f2 100644
--- a/tests/long-help.txt
+++ b/tests/long-help.txt
@@ -100,6 +100,14 @@ OPTIONS:
 
             This flag can only be used together with --feature-powerset flag.
 
+        --target <TRIPLE>
+            Build for specified target triple.
+
+            Comma-separated lists of targets are not supported, but you can specify the whole
+            --target option multiple times to do multiple targets.
+
+            This is actually not a cargo-hack option, it is interpreted by Cargo itself.
+
         --mutually-exclusive-features <FEATURES>...
             Space or comma separated list of features to not use together.
 
diff --git a/tests/short-help.txt b/tests/short-help.txt
index 5185a78..5ed21b1 100644
--- a/tests/short-help.txt
+++ b/tests/short-help.txt
@@ -24,6 +24,7 @@ OPTIONS:
         --depth <NUM>                    Specify a max number of simultaneous feature flags of
                                          --feature-powerset
         --group-features <FEATURES>...   Space or comma separated list of features to group
+        --target <TRIPLE>                Build for specified target triple
         --mutually-exclusive-features <FEATURES>... Space or comma separated list of features to not use
                                          together
         --at-least-one-of <FEATURES>...  Space or comma separated list of features. Skips sets of