-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from nordic-dev-net/cargo_workspace
Cargo workspace
- Loading branch information
Showing
9 changed files
with
130 additions
and
78 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
[package] | ||
name = "hydrophonitor-cli" | ||
version = "0.1.0" | ||
edition = "2021" | ||
[workspace] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
members = [ | ||
"cli", | ||
"lib", | ||
] | ||
|
||
[dependencies] | ||
[workspace.dependencies] | ||
anyhow = "1.0.70" | ||
clap = { version = "4.1.11", features = ["derive"] } | ||
clap-verbosity-flag = "2.1.0" | ||
env_logger = "0.10.1" | ||
hound = "3.5.0" | ||
indicatif = "0.17.3" | ||
walkdir = "2.3.3" | ||
log = "0.4" | ||
env_logger = "0.10.1" | ||
clap-verbosity-flag = "2.1.0" | ||
walkdir = "2.3.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "hydrophonitor-cli" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
hydrophonitor-lib = { path = "../lib" } | ||
anyhow.workspace = true | ||
clap.workspace = true | ||
clap-verbosity-flag.workspace = true | ||
env_logger.workspace = true | ||
hound.workspace = true | ||
indicatif.workspace = true | ||
log.workspace = true | ||
walkdir.workspace = true |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use std::path::PathBuf; | ||
|
||
use clap::Parser; | ||
|
||
use hydrophonitor_lib::import::import; | ||
|
||
#[derive(Parser, Debug)] | ||
#[clap(about = "Import audio from an SD card.")] | ||
pub struct Import { | ||
/// Path to USB mass storage or SD where data will be imported from. You can find the path to | ||
/// the SD card by running `lsblk` in the terminal. | ||
#[clap(short, long, required = true)] | ||
pub device: PathBuf, | ||
|
||
/// Path to the output folder. If not specified, the output folder will be | ||
/// the current directory. | ||
#[clap(short, long)] | ||
pub output: Option<PathBuf>, | ||
|
||
///Runs a clean after import is complete. | ||
#[clap(long, action)] | ||
pub clean_imported: bool, | ||
|
||
///Generates compressed previews of audio files. | ||
#[clap(long, action)] | ||
pub audio_previews: bool, | ||
} | ||
|
||
impl Import { | ||
//TODO old logic; has to be changed to match new commands | ||
pub fn import(&mut self) { | ||
import(&mut self.device, self.output.clone()) | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
name = "hydrophonitor-lib" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
anyhow.workspace = true | ||
hound.workspace = true | ||
indicatif.workspace = true | ||
log.workspace = true | ||
walkdir.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod import; |