Skip to content

Commit

Permalink
update CLI docs
Browse files Browse the repository at this point in the history
  • Loading branch information
simleo committed Jan 10, 2024
1 parent bb4e345 commit 1b5d67f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ The command acts on the current directory, unless the `-c` option is specified.

### Adding items to the crate

The `rocrate add` command allows to add workflows and other entity types (currently [testing-related metadata](https://crs4.github.io/life_monitor/workflow_testing_ro_crate)) to an RO-Crate:
The `rocrate add` command allows to add file, datasets (directories), workflows and other entity types (currently [testing-related metadata](https://crs4.github.io/life_monitor/workflow_testing_ro_crate)) to an RO-Crate:

```console
$ rocrate add --help
Expand All @@ -320,6 +320,8 @@ Options:
--help Show this message and exit.

Commands:
dataset
file
test-definition
test-instance
test-suite
Expand Down Expand Up @@ -372,6 +374,29 @@ rocrate add test-instance test1 http://example.com -r jobs -i test1_1
rocrate add test-definition test1 test/test1/sort-and-change-case-test.yml -e planemo -v '>=0.70'
```

To add files or directories after crate initialization:

```bash
cp ../sample_file.txt .
rocrate add file sample_file.txt -P name=sample -P description="Sample file"
cp -r ../test_add_dir .
rocrate add dataset test_add_dir
```

The above example also shows how to set arbitrary properties for the entity with `-P`. This is supported by most `rocrate add` subcommands.

```console
$ rocrate add workflow --help
Usage: rocrate add workflow [OPTIONS] PATH

Options:
-l, --language [cwl|galaxy|knime|nextflow|snakemake|compss|autosubmit]
-c, --crate-dir PATH
-P, --property KEY=VALUE
--help Show this message and exit.
```


## License

* Copyright 2019-2024 The University of Manchester, UK
Expand Down
2 changes: 1 addition & 1 deletion rocrate/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def convert(self, value, param, ctx):
CSV = CSVParamType()
KeyValue = KeyValueParamType()
OPTION_CRATE_PATH = click.option('-c', '--crate-dir', type=click.Path(), default=os.getcwd)
OPTION_PROPS = click.option('-P', '--property', type=KeyValue, multiple=True)
OPTION_PROPS = click.option('-P', '--property', type=KeyValue, multiple=True, metavar="KEY=VALUE")


@click.group()
Expand Down

0 comments on commit 1b5d67f

Please sign in to comment.