changeset 53160:2b1ac433d291

rhg: allow --repo as abbreviation for --repository This matches Python behavior.
author Mitchell Kember <mkember@janestreet.com>
date Wed, 02 Apr 2025 14:45:32 -0400
parents 09b379b2047c
children df58357b656a
files rust/rhg/src/main.rs
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rust/rhg/src/main.rs	Wed Apr 02 14:11:35 2025 -0400
+++ b/rust/rhg/src/main.rs	Wed Apr 02 14:45:32 2025 -0400
@@ -10,7 +10,7 @@
 use std::borrow::Cow;
 use std::collections::{HashMap, HashSet};
 use std::ffi::OsString;
-use std::os::unix::ffi::{OsStrExt, OsStringExt};
+use std::os::unix::ffi::OsStrExt;
 use std::os::unix::prelude::CommandExt;
 use std::path::PathBuf;
 use std::process::Command;
@@ -737,13 +737,14 @@
     Color,
     Cwd,
     Repository,
+    Repo,
     R,
 }
 
 impl EarlyFlag {
     const fn all() -> &'static [EarlyFlag] {
         use EarlyFlag::*;
-        &[Config, Color, Cwd, Repository, R]
+        &[Config, Color, Cwd, Repository, Repo, R]
     }
 
     const fn as_str(&self) -> &'static str {
@@ -752,6 +753,7 @@
             EarlyFlag::Color => "--color",
             EarlyFlag::Cwd => "--cwd",
             EarlyFlag::Repository => "--repository",
+            EarlyFlag::Repo => "--repo",
             EarlyFlag::R => "-R",
         }
     }
@@ -802,7 +804,7 @@
                     EarlyFlag::Config => this.config.push(value),
                     EarlyFlag::Color => this.color = Some(value),
                     EarlyFlag::Cwd => this.cwd = Some(value),
-                    EarlyFlag::Repository | EarlyFlag::R => {
+                    EarlyFlag::Repository | EarlyFlag::Repo | EarlyFlag::R => {
                         this.repo = Some(value);
                     }
                 }