Skip to content

Commit

Permalink
Update doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iesahin committed Nov 8, 2023
1 parent d135972 commit 83452b4
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 49 deletions.
6 changes: 0 additions & 6 deletions book/src/ref/xvc-pipeline-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,6 @@ This way you can edit and import similar pipelines with minor differences.

```console
$ xvc pipeline import --pipeline-name another-pipeline --file pipeline.yaml
? 2
error: unexpected argument '--name' found

Usage: xvc pipeline import [OPTIONS]

For more information, try '--help'.

```

Expand Down
38 changes: 16 additions & 22 deletions book/src/ref/xvc-pipeline-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,20 @@ You can create a new pipeline with a name.

```console
$ xvc pipeline new --pipeline-name my-pipeline
? 2
error: unexpected argument '--name' found

Usage: xvc pipeline new [OPTIONS] --pipeline-name <PIPELINE_NAME>

For more information, try '--help'.

```

By default it will run the commands in the repository root.

```console
$ xvc pipeline list
+---------+---------+
| Name | Run Dir |
+===================+
| default | |
+---------+---------+
+-------------+---------+
| Name | Run Dir |
+=======================+
| default | |
|-------------+---------|
| my-pipeline | |
+-------------+---------+

```

Expand All @@ -55,23 +51,21 @@ If you want to define a pipeline specific to a directory, you can set the workin
```console
$ xvc-test-helper create-directory-tree --directories 1 --files 3 --seed 20230215
$ xvc pipeline new --pipeline-name another-pipeline --workdir dir-0001
? 2
error: unexpected argument '--name' found

Usage: xvc pipeline new [OPTIONS] --pipeline-name <PIPELINE_NAME>

For more information, try '--help'.

```

The pipeline will run the commands in the specified directory.

```console
$ xvc pipeline list
+---------+---------+
| Name | Run Dir |
+===================+
| default | |
+---------+---------+
+------------------+----------+
| Name | Run Dir |
+=============================+
| default | |
|------------------+----------|
| my-pipeline | |
|------------------+----------|
| another-pipeline | dir-0001 |
+------------------+----------+

```
21 changes: 3 additions & 18 deletions book/src/ref/xvc-pipeline-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,30 +75,15 @@ You can run a specific pipeline by specifying its name with `--name` option.

```console
$ xvc pipeline new --pipeline-name my-pipeline
? 2
error: unexpected argument '--name' found

Usage: xvc pipeline new [OPTIONS] --pipeline-name <PIPELINE_NAME>

For more information, try '--help'.

$ xvc pipeline --pipeline-name my-pipeline step new --step-name my-hello --command "echo 'hello from my-pipeline'"
? 2
error: unexpected argument '--name' found

Usage: xvc pipeline [OPTIONS] <COMMAND>

For more information, try '--help'.

```

```console
$ xvc pipeline run --pipeline-name my-pipeline
? 2
error: unexpected argument '--name' found

Usage: xvc pipeline run [OPTIONS]

For more information, try '--help'.
[OUT] [my-hello] hello from my-pipeline
[DONE] my-hello (echo 'hello from my-pipeline')

```
2 changes: 1 addition & 1 deletion lib/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ fn git_checkout_ref(

/// This receives `xvc_root` ownership because as a final operation, it must drop the root to
/// record the last entity counter before commit.
fn handle_git_automation(
pub fn handle_git_automation(
output_snd: &XvcOutputSender,
xvc_root: XvcRoot,
to_branch: Option<&str>,
Expand Down
4 changes: 3 additions & 1 deletion lib/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ pub enum Error {
#[from]
source: serde_yaml::Error,
},
#[error("[E2004] Requires xvc repository.")]

#[error("This command requires Xvc repository. Please use xvc init first.")]
RequiresXvcRepository,

#[error("I/O Error: {source}")]
IoError {
#[from]
Expand Down
2 changes: 1 addition & 1 deletion lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub use xvc_walker as walker;

pub use xvc_logging::watch;

pub use crate::error::Result;
pub use crate::error::{Error, Result};

/// Adds `xvc` as the first elements to `args` and calls [cli::dispatch] after parsing them.
pub fn dispatch(args: Vec<&str>) -> Result<()> {
Expand Down

0 comments on commit 83452b4

Please sign in to comment.