PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: google/argh (rust)

Issue:
A single quote is missing in the "Error parsing positional argument" message
I tried:
```rust
#[derive(argh::FromArgs)]
#[argh(description = "...")]
struct Args {
    #[argh(positional)]
    n: usize,
}
```
When I ran `cargo run invalid-argument`, it printed:
```
Error parsing positional argument 'n' with value 'invalid-argument: invalid digit found in string
```
A single quote was missing. It should be `Error parsing positional argument 'n' with value 'invalid-argument': invalid digit found in string`, just like error messages for non-positional arguments:
https://github.com/google/argh/blob/8d9a82f46634a4dd2600872f93e449cf23eb5299/src/lib.rs#L429
Corresponding source code:
https://github.com/google/argh/blob/8d9a82f46634a4dd2600872f93e449cf23eb5299/src/lib.rs#L448
A single quote should be inserted after `arg`.

Pull request:
Fix quoting in errors when parsing arguments
This closes quotes in error messages when parsing arguments.

Test: Added tests to make sure the error message when parsing arguments is as expected, as well as added a test to check parsing options.

Closes #52

Patch:
diff --git a/src/lib.rs b/src/lib.rs
index ae16a6a..9dc662a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -445,7 +445,8 @@ pub fn parse_positional(
 ) -> Result<(), String> {
     let (slot, name) = positional;
     slot.fill_slot(arg).map_err(|s| {
-        ["Error parsing positional argument '", name, "' with value '", arg, ": ", &s].concat()
+        ["Error parsing positional argument '", name, "' with value '", arg, "': ", &s, "\n"]
+            .concat()
     })
 }
 


Test patch:
diff --git a/tests/lib.rs b/tests/lib.rs
index 428015c..b27f3ef 100644
--- a/tests/lib.rs
+++ b/tests/lib.rs
@@ -206,6 +206,28 @@ fn assert_error<T: FromArgs + Debug>(args: &[&str], err_msg: &str) {
     e.status.expect_err("error had a positive status");
 }
 
+mod options {
+    use super::*;
+
+    #[derive(argh::FromArgs, Debug, PartialEq)]
+    /// Woot
+    struct Parsed {
+        #[argh(option, short = 'n')]
+        /// fooey
+        n: usize,
+    }
+
+    #[test]
+    fn parsed() {
+        assert_output(&["-n", "5"], Parsed { n: 5 });
+        assert_error::<Parsed>(
+            &["-n", "x"],
+            r###"Error parsing option '-n' with value 'x': invalid digit found in string
+"###,
+        );
+    }
+}
+
 mod positional {
     use super::*;
 
@@ -304,6 +326,24 @@ Options:
         );
     }
 
+    #[derive(argh::FromArgs, Debug, PartialEq)]
+    /// Woot
+    struct Parsed {
+        #[argh(positional)]
+        /// fooey
+        n: usize,
+    }
+
+    #[test]
+    fn parsed() {
+        assert_output(&["5"], Parsed { n: 5 });
+        assert_error::<Parsed>(
+            &["x"],
+            r###"Error parsing positional argument 'n' with value 'x': invalid digit found in string
+"###,
+        );
+    }
+
     #[derive(FromArgs, Debug, PartialEq)]
     /// Woot
     struct WithOption {