1use super::args::Args;
2use crate::{cmd, Command};
3use ql2::term::TermType;
4
5pub trait Arg {
6 fn arg(self) -> cmd::Arg<()>;
7}
8
9impl Arg for Command {
10 fn arg(self) -> cmd::Arg<()> {
11 Self::new(TermType::DeleteAt).with_arg(self).into_arg()
12 }
13}
14
15impl Arg for i64 {
16 fn arg(self) -> cmd::Arg<()> {
17 Command::from_json(self).arg()
18 }
19}
20
21impl Arg for Args<[i64; 2]> {
22 fn arg(self) -> cmd::Arg<()> {
23 let Args([offset, end_offset]) = self;
24 Command::from_json(offset)
25 .arg()
26 .with_arg(Command::from_json(end_offset))
27 }
28}