diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 0a22f4a..e2b6712 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -2,11 +2,6 @@ on: push: - branches: [ "main" ] - tags: - - '*' - pull_request: - branches: [ "main" ] jobs: release: diff --git a/Cargo.lock b/Cargo.lock index 78b8f1c..751a272 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -974,7 +974,7 @@ dependencies = [ [[package]] name = "ro-crate-rs-cli" -version = "0.4.4" +version = "0.4.5" dependencies = [ "chrono", "clap", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 3203c35..684a92e 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,7 +1,14 @@ [package] name = "ro-crate-rs-cli" -version = "0.4.4" +version = "0.4.5" edition = "2021" +repository = "https://github.com/intbio-ncl/ro-crate-rs" +authors = ["Matt Burridge "] +autoexamples = false +license = "Apache-2.0" +description = "Cli tool for creating, modifying, validating and reading RO-Crates" +keywords = ["researchobject","ro-crate","ro","metadata","jsonld"] +categories = ["command-line-utilities"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/cli/src/args.rs b/cli/src/args.rs index f02d22f..2fd8395 100644 --- a/cli/src/args.rs +++ b/cli/src/args.rs @@ -41,6 +41,7 @@ pub struct InitCommand { pub default: bool, /// Type of context #[clap(required_unless_present = "default")] + #[clap(required_unless_present = "minimal")] #[clap(short, long, name="context", help=CONTEXT_HELP)] pub context_type: Option, /// Initialise with default minimal entites or leave empty diff --git a/cli/src/main.rs b/cli/src/main.rs index 8cc6eef..f1f34d7 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -28,12 +28,16 @@ fn main() { match args.crate_action { CrateAction::Init(init_command) => { - if init_command.default { + if init_command.minimal { let mut rocrate = RoCrate::default(); + rocrate = create_default_crate(rocrate); + write_crate(&rocrate, "ro-crate-metadata.json".to_string()); + return; + } + + if init_command.default { + let rocrate = RoCrate::default(); println!("{:?}", rocrate); - if init_command.minimal { - rocrate = create_default_crate(rocrate); - } write_crate(&rocrate, "ro-crate-metadata.json".to_string()) } else {