1use crate::client::{Client, HglibError, Runner};
6use crate::{runcommand, MkArg};
7
8pub struct Arg<'a> {
9 pub files: &'a [&'a str],
10 pub include: &'a [&'a str],
11 pub exclude: &'a [&'a str],
12}
13
14impl<'a> Default for Arg<'a> {
15 fn default() -> Self {
16 Self {
17 files: &[],
18 include: &[],
19 exclude: &[],
20 }
21 }
22}
23
24impl<'a> Arg<'a> {
25 fn run(&self, client: &mut Client) -> Result<(Vec<u8>, i32), HglibError> {
26 runcommand!(
27 client,
28 "forget",
29 self.files,
30 "-I",
31 self.include,
32 "-X",
33 self.exclude
34 )
35 }
36}
37
38impl Client {
39 pub fn forget(&mut self, x: Arg) -> Result<bool, HglibError> {
40 HglibError::handle_err(x.run(self))
41 }
42}