Loading Cargo.lock +4 −3 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ dependencies = [ "aho-corasick", "bat", "bon", "chrono", "clap", "color-eyre", "comfy-table", Loading Loading @@ -584,9 +585,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" version = "0.4.39" version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", Loading @@ -594,7 +595,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", "windows-targets 0.52.6", "windows-link", ] [[package]] Loading README.md +20 −5 Original line number Diff line number Diff line Loading @@ -2,14 +2,12 @@ [](https://code.ornl.gov/research-enablement/acorn/-/releases) > Accessible Content Optimization for Research Needs ## Quick Start > 🚧 Under Construction ## Installation > Homebrew and Scoop packages are planned. Check back soon for updates. ### Download pre-compiled binary - Download newest binary from [releases page](https://code.ornl.gov/research-enablement/acorn/-/releases) ```shell curl -LO https://code.ornl.gov/api/v4/projects/16689/packages/generic/x86_64-unknown-linux-gnu/v0.0.3/acorn curl -LO https://code.ornl.gov/api/v4/projects/16689/packages/generic/x86_64-unknown-linux-gnu/v0.1.24/acorn ``` - Make binary executable ```shell Loading @@ -22,6 +20,23 @@ - Verify installation with `acorn --version` > ⚠️ **CAUTION** `acorn export` is [not currently supported on MacOS](https://code.ornl.gov/research-enablement/acorn/-/issues/4) ### Install with cargo - Clone this project and navigate to it ```shell git clone https://code.ornl.gov/research-enablement/acorn cd ./acorn ``` - Install `acorn` command ```shell cargo install --path ./acorn-cli ``` - Test the installation ```shell acorn help ``` ## Architecture > See [ARCHITECTURE.md](./ARCHITECTURE.md) Loading acorn-cli/src/cli/mod.rs +33 −0 Original line number Diff line number Diff line Loading @@ -262,8 +262,41 @@ pub enum Commands { #[command(flatten)] verbose: Verbosity, }, /// Add linked data context to research activity data /// /// $> acorn link /path/to/data/ #[clap(verbatim_doc_comment, next_help_heading = "FLAGS")] Link { /// Path to look for files to process #[arg(default_value = "./", required = false, value_name = "PATH", value_hint = ValueHint::DirPath, help_heading = "OPTIONS")] path: Option<PathBuf>, /// Process files that were changed in a given Git branch #[arg(short, long, value_name = "BRANCH", help_heading = "OPTIONS")] branch: Option<String>, /// Process files that were changed in a given Git commit #[arg(short, long, value_name = "COMMIT", help_heading = "OPTIONS")] commit: Option<String>, /// Run link without making changes to target file(s). Will print a diff of changes. #[arg(short, long = "dry-run", value_name = "BOOL", help_heading = "FLAGS")] dry_run: bool, /// Regex pattern applied to absolute paths of files that determines whether they should be included in processing /// /// Only applies to path values that point to a directory /// /// Patterns that contain whitespace or special characters should be enclosed in quotes for most terminals /// /// Example: --ignore "[/]valid.json$" #[arg(short, long, value_name = "REGEX", help_heading = "OPTIONS")] ignore: Option<String>, /// Processes files that were changed in a given merge request (Gitlab) or pull request (Github) #[arg(short, long = "merge-request", value_name = "BOOL", help_heading = "FLAGS")] merge_request: bool, #[command(flatten)] verbose: Verbosity, }, /// Print research activity data (RAD) JSON schema /// /// $> acorn schema #[clap(verbatim_doc_comment, next_help_heading = "FLAGS")] Schema {}, } Loading acorn-cli/src/commands/link/mod.rs 0 → 100644 +13 −0 Original line number Diff line number Diff line use color_eyre::eyre::{Report, Result}; use std::path::PathBuf; pub fn run( _path: &Option<PathBuf>, _branch: &Option<String>, _commit: &Option<String>, _ignore: &Option<String>, _dry_run: bool, _merge_request: bool, ) -> Result<(), Report> { Ok(()) } acorn-cli/src/commands/mod.rs +1 −0 Original line number Diff line number Diff line Loading @@ -3,4 +3,5 @@ pub mod doctor; pub mod download; pub mod export; pub mod format; pub mod link; pub mod schema; Loading
Cargo.lock +4 −3 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ dependencies = [ "aho-corasick", "bat", "bon", "chrono", "clap", "color-eyre", "comfy-table", Loading Loading @@ -584,9 +585,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" version = "0.4.39" version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", Loading @@ -594,7 +595,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", "windows-targets 0.52.6", "windows-link", ] [[package]] Loading
README.md +20 −5 Original line number Diff line number Diff line Loading @@ -2,14 +2,12 @@ [](https://code.ornl.gov/research-enablement/acorn/-/releases) > Accessible Content Optimization for Research Needs ## Quick Start > 🚧 Under Construction ## Installation > Homebrew and Scoop packages are planned. Check back soon for updates. ### Download pre-compiled binary - Download newest binary from [releases page](https://code.ornl.gov/research-enablement/acorn/-/releases) ```shell curl -LO https://code.ornl.gov/api/v4/projects/16689/packages/generic/x86_64-unknown-linux-gnu/v0.0.3/acorn curl -LO https://code.ornl.gov/api/v4/projects/16689/packages/generic/x86_64-unknown-linux-gnu/v0.1.24/acorn ``` - Make binary executable ```shell Loading @@ -22,6 +20,23 @@ - Verify installation with `acorn --version` > ⚠️ **CAUTION** `acorn export` is [not currently supported on MacOS](https://code.ornl.gov/research-enablement/acorn/-/issues/4) ### Install with cargo - Clone this project and navigate to it ```shell git clone https://code.ornl.gov/research-enablement/acorn cd ./acorn ``` - Install `acorn` command ```shell cargo install --path ./acorn-cli ``` - Test the installation ```shell acorn help ``` ## Architecture > See [ARCHITECTURE.md](./ARCHITECTURE.md) Loading
acorn-cli/src/cli/mod.rs +33 −0 Original line number Diff line number Diff line Loading @@ -262,8 +262,41 @@ pub enum Commands { #[command(flatten)] verbose: Verbosity, }, /// Add linked data context to research activity data /// /// $> acorn link /path/to/data/ #[clap(verbatim_doc_comment, next_help_heading = "FLAGS")] Link { /// Path to look for files to process #[arg(default_value = "./", required = false, value_name = "PATH", value_hint = ValueHint::DirPath, help_heading = "OPTIONS")] path: Option<PathBuf>, /// Process files that were changed in a given Git branch #[arg(short, long, value_name = "BRANCH", help_heading = "OPTIONS")] branch: Option<String>, /// Process files that were changed in a given Git commit #[arg(short, long, value_name = "COMMIT", help_heading = "OPTIONS")] commit: Option<String>, /// Run link without making changes to target file(s). Will print a diff of changes. #[arg(short, long = "dry-run", value_name = "BOOL", help_heading = "FLAGS")] dry_run: bool, /// Regex pattern applied to absolute paths of files that determines whether they should be included in processing /// /// Only applies to path values that point to a directory /// /// Patterns that contain whitespace or special characters should be enclosed in quotes for most terminals /// /// Example: --ignore "[/]valid.json$" #[arg(short, long, value_name = "REGEX", help_heading = "OPTIONS")] ignore: Option<String>, /// Processes files that were changed in a given merge request (Gitlab) or pull request (Github) #[arg(short, long = "merge-request", value_name = "BOOL", help_heading = "FLAGS")] merge_request: bool, #[command(flatten)] verbose: Verbosity, }, /// Print research activity data (RAD) JSON schema /// /// $> acorn schema #[clap(verbatim_doc_comment, next_help_heading = "FLAGS")] Schema {}, } Loading
acorn-cli/src/commands/link/mod.rs 0 → 100644 +13 −0 Original line number Diff line number Diff line use color_eyre::eyre::{Report, Result}; use std::path::PathBuf; pub fn run( _path: &Option<PathBuf>, _branch: &Option<String>, _commit: &Option<String>, _ignore: &Option<String>, _dry_run: bool, _merge_request: bool, ) -> Result<(), Report> { Ok(()) }
acorn-cli/src/commands/mod.rs +1 −0 Original line number Diff line number Diff line Loading @@ -3,4 +3,5 @@ pub mod doctor; pub mod download; pub mod export; pub mod format; pub mod link; pub mod schema;