vectorizer/
commands.rs

1//!
2//! CLI commands of the tool.
3//!
4
5/// Internal namespace.
6mod private
7{
8  use crate::*;
9  use clap::{ Parser, Subcommand, Args };
10  use commands::raster ;
11  use std::path::PathBuf;
12
13  /// CLI commands of the tool.
14  #[ derive ( Debug, Parser ) ]
15  pub struct Cli
16  {
17    /// Root of the CLI commands.
18    #[ command ( subcommand ) ]
19    pub command : CliCommand,
20  }
21
22  /// Root of the CLI commands.
23  ///
24  /// This enum defines the root commands available in the CLI tool, each corresponding to a different API or functionality.
25  /// Each variant contains the specific subcommands and arguments required for that functionality.
26  ///
27  /// # Variants
28  /// * `Raster` - Commands for vectorizing raster images.
29  ///   - Includes subcommands for color and layers vectorization methods.
30
31  #[ derive ( Debug, Subcommand ) ]
32  pub enum CliCommand
33  {
34    /// Raster API commands.
35    #[ command ( subcommand, name = "raster" ) ]
36    Raster( raster::Command ),
37  }
38  /// Represents configuration for input and output file paths.
39  #[ derive( Debug, Args, Default ) ]
40  pub struct InputOutput
41  {
42    /// Input file
43    #[ arg( long, short ) ]
44    pub input : PathBuf,
45
46    /// Output file
47    #[ arg( long, short ) ]
48    pub output : Option< PathBuf >,
49  }
50}
51
52crate::mod_interface!
53{
54  layer raster;
55
56  own use
57  {
58    Cli,
59    CliCommand,
60    InputOutput,
61  };
62}