diff --git a/crates/radicle-cli/src/commands/init/args.rs b/crates/radicle-cli/src/commands/init/args.rs index c2a80919..fdf10ac5 100644 --- a/crates/radicle-cli/src/commands/init/args.rs +++ b/crates/radicle-cli/src/commands/init/args.rs @@ -8,6 +8,8 @@ use radicle::{ }; use radicle_term::Interactive; +use crate::terminal::args::ScopeParser; + const ABOUT: &str = "Initialize a Radicle repository"; #[derive(Debug, Parser)] @@ -85,33 +87,6 @@ impl Args { } } -// TODO(finto): this is duplicated from `clone::args`. Consolidate these once -// the `clap` migration has finished and we can organise the shared code. -#[derive(Clone, Debug)] -struct ScopeParser; - -impl clap::builder::TypedValueParser for ScopeParser { - type Value = Scope; - - fn parse_ref( - &self, - cmd: &clap::Command, - arg: Option<&clap::Arg>, - value: &std::ffi::OsStr, - ) -> Result { - ::from_str.parse_ref(cmd, arg, value) - } - - fn possible_values( - &self, - ) -> Option + '_>> { - use clap::builder::PossibleValue; - Some(Box::new( - [PossibleValue::new("all"), PossibleValue::new("followed")].into_iter(), - )) - } -} - #[cfg(test)] mod test { use super::Args;