|
1 | 1 | use std::path::PathBuf;
|
2 | 2 |
|
3 |
| -use clap::{Parser, Subcommand}; |
| 3 | +use clap::{Args, Parser, Subcommand}; |
4 | 4 | use hifitime::Epoch;
|
5 | 5 |
|
6 | 6 | #[derive(Parser, Debug)]
|
7 | 7 | #[clap(name="ANISE", author="Rabotin and ANISE contributors", version, about, long_about = None)]
|
8 |
| -pub struct Args { |
| 8 | +pub struct CliArgs { |
9 | 9 | #[clap(subcommand)]
|
10 | 10 | pub action: Actions,
|
11 | 11 | }
|
@@ -43,26 +43,32 @@ pub enum Actions {
|
43 | 43 | /// Truncate the segment of the provided ID of the input NAIF DAF file to the provided start and end epochs
|
44 | 44 | /// Limitation: this may not work correctly if there are several segments with the same ID.
|
45 | 45 | /// Only works with Chebyshev Type 2 data types (i.e. planetary ephemerides).
|
46 |
| - TruncDAFById { |
47 |
| - /// Input DAF file, SPK or BPC |
48 |
| - input: PathBuf, |
49 |
| - /// Output DAF file path |
50 |
| - output: PathBuf, |
51 |
| - /// ID of the segment to truncate |
52 |
| - id: i32, |
53 |
| - /// New start epoch of the segment |
54 |
| - start: Option<Epoch>, |
55 |
| - /// New end epoch of the segment |
56 |
| - end: Option<Epoch>, |
57 |
| - }, |
| 46 | + TruncDAFById(TruncateById), |
58 | 47 | /// Remove the segment of the provided ID of the input NAIF DAF file.
|
59 | 48 | /// Limitation: this may not work correctly if there are several segments with the same ID.
|
60 |
| - RmDAFById { |
61 |
| - /// Input DAF file, SPK or BPC |
62 |
| - input: PathBuf, |
63 |
| - /// Output DAF file path |
64 |
| - output: PathBuf, |
65 |
| - /// ID of the segment to truncate |
66 |
| - id: i32, |
67 |
| - }, |
| 49 | + RmDAFById(RmById), |
| 50 | +} |
| 51 | + |
| 52 | +#[derive(Debug, PartialEq, Eq, PartialOrd, Args)] |
| 53 | +pub(crate) struct RmById { |
| 54 | + /// Input DAF file, SPK or BPC |
| 55 | + pub input: PathBuf, |
| 56 | + /// Output DAF file path |
| 57 | + pub output: PathBuf, |
| 58 | + /// ID of the segment to truncate |
| 59 | + pub id: i32, |
| 60 | +} |
| 61 | + |
| 62 | +#[derive(Debug, PartialEq, Eq, PartialOrd, Args)] |
| 63 | +pub(crate) struct TruncateById { |
| 64 | + /// Input DAF file, SPK or BPC |
| 65 | + pub input: PathBuf, |
| 66 | + /// Output DAF file path |
| 67 | + pub output: PathBuf, |
| 68 | + /// ID of the segment to truncate |
| 69 | + pub id: i32, |
| 70 | + /// New start epoch of the segment |
| 71 | + pub start: Option<Epoch>, |
| 72 | + /// New end epoch of the segment |
| 73 | + pub end: Option<Epoch>, |
68 | 74 | }
|
0 commit comments