File size: 457 Bytes
f14b4e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use clap::ValueEnum;
use firm_core::graph::Direction;

/// Wraps the underlying graph direction enum, allowing it to be used by clap.
#[derive(Clone, Debug, ValueEnum, PartialEq)]
pub enum CliDirection {
    To,
    From,
}

impl From<CliDirection> for Direction {
    fn from(dir: CliDirection) -> Direction {
        match dir {
            CliDirection::To => Direction::Incoming,
            CliDirection::From => Direction::Outgoing,
        }
    }
}