1use crate::command::Command;
2use crate::core::git::GitOperations;
3
4pub fn run() -> crate::Result<()> {
5 let cmd = GraphCommand;
6 cmd.execute(())
7}
8
9pub struct GraphCommand;
11
12impl Command for GraphCommand {
13 type Input = ();
14 type Output = ();
15
16 fn execute(&self, _input: ()) -> crate::Result<()> {
17 let output = GitOperations::run(&["log", "--oneline", "--graph", "--decorate", "--all"])?;
18 println!("{output}");
19 Ok(())
20 }
21
22 fn name(&self) -> &'static str {
23 "graph"
24 }
25
26 fn description(&self) -> &'static str {
27 "Show a simple git log graph"
28 }
29}