• it/its

// the deer!
// plural deer therian θΔ, trans demigirl
// stray pet with a keyboard
// i'm 20 & account is 18+!
name-color: #ebe41e
// yeah



gankra
@gankra

Just cargo install cargo-mommy and she'll take care of you~ ❤️

You can set CARGO_MOMMYS_LITTLE in your environment to any affectionate term you want, and be mommy's little boy or mommy's little kitten~ ❤️


gankra
@gankra

i've been stunlocked by migraines for like 2 weeks and in a brief moment of lucidity i smashed a piece of old furniture to bits with my bare hands and then sat down and wrote this


You must log in to comment.

in reply to @gankra's post:

in reply to @gankra's post:

Patch to allow running it as /path/to/cargo-mommy - I think this is also what PR#1 intended:

diff --git a/src/main.rs b/src/main.rs
index 014b891..728646f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -3,9 +3,14 @@ use std::process::ExitCode;
 fn main() -> Result<ExitCode, Box<dyn std::error::Error>> {
     let cargo = std::env::var("CARGO")?;
     let mommys_little = std::env::var("CARGO_MOMMYS_LITTLE").unwrap_or_else(|_| "girl".to_owned());
-    let mut arg_iter = std::env::args();
+    let mut arg_iter = std::env::args().peekable();
     let _cargo = arg_iter.next();
-    let _mommy = arg_iter.next();
+    // When dispatched by cargo, we're given 'mommy' as the second argument.
+    // That argument isn't there if called directly.
+    let maybe_mommy = arg_iter.peek();
+    if matches!(maybe_mommy, Some(s) if *s == "mommy") {
+        _ = arg_iter.next();
+    }
 
     let mut cmd = std::process::Command::new(cargo);
     cmd.args(arg_iter);