|
1 | 1 | use clap::{Parser, Subcommand, crate_description, crate_version}; |
2 | 2 | use clap_complete::Shell; |
3 | 3 | use parquet::ComplexTypesMode; |
| 4 | +pub mod hdf5; |
4 | 5 | pub mod tdms; |
| 6 | +use hdf5::Hdf5Schema; |
5 | 7 | use std::path::PathBuf; |
6 | 8 | use tdms::TdmsFallbackMethod; |
7 | 9 |
|
@@ -161,6 +163,11 @@ pub enum ImportCmd { |
161 | 163 | /// Import a Tdms file into Sift. |
162 | 164 | Tdms(ImportTdmsArgs), |
163 | 165 |
|
| 166 | + /// Import an HDF5 file into Sift. Supported channel types: bool, |
| 167 | + /// int8/16/32/64, uint8/16/32/64, float32, float64. Datasets with other |
| 168 | + /// types will produce a client-side error. |
| 169 | + Hdf5(ImportHdf5Args), |
| 170 | + |
164 | 171 | /// Import backup files generated by sift_stream into Sift. |
165 | 172 | #[command(name = "backups")] |
166 | 173 | Backup(BackupArgs), |
@@ -420,3 +427,31 @@ pub struct ImportTdmsArgs { |
420 | 427 | #[arg(long)] |
421 | 428 | pub import_file_properties: bool, |
422 | 429 | } |
| 430 | + |
| 431 | +#[derive(clap::Args)] |
| 432 | +pub struct ImportHdf5Args { |
| 433 | + #[command(flatten)] |
| 434 | + pub common: CommonImportArgs, |
| 435 | + |
| 436 | + /// Schema type for the HDF5 file. Supported channel types across all |
| 437 | + /// schemas: bool, int8/16/32/64, uint8/16/32/64, float32, float64. |
| 438 | + #[arg(long)] |
| 439 | + pub schema: Hdf5Schema, |
| 440 | + |
| 441 | + /// Time format used in the time dataset/column |
| 442 | + #[arg(long)] |
| 443 | + pub time_format: Option<TimeFormat>, |
| 444 | + |
| 445 | + /// Start time (RFC3339) if the time format is relative |
| 446 | + #[arg(short = 's', long)] |
| 447 | + pub relative_start_time: Option<String>, |
| 448 | + |
| 449 | + /// (two-d / compound) Index of the time column or field. Defaults to 0. |
| 450 | + /// Mutually exclusive with --time-field. |
| 451 | + #[arg(long, conflicts_with = "time_field")] |
| 452 | + pub time_index: Option<u64>, |
| 453 | + |
| 454 | + /// (compound) Name of the time field. Mutually exclusive with --time-index. |
| 455 | + #[arg(long)] |
| 456 | + pub time_field: Option<String>, |
| 457 | +} |
0 commit comments