Skip to content

Commit

Permalink
moved out cli.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuxmon committed Apr 5, 2024
1 parent 567320e commit 7a3b857
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 45 deletions.
47 changes: 47 additions & 0 deletions cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# CLI Usage Examples

When using CLI you need to supply a path to your XML mutation file. A single XML mutation file can contain multiple mutation definitions. Next, you decide if you want to specify XML files one by one and use the [include command](#include-command) or scan the directory and use the [scan command](#scan-command). You can consult how to use CLI with a `help` call.

```bash
xml-mut --help
```

## include command

You can consult how to use the include command with a `help` call:

```bash
xml-mut include --help
```

The usage is as follows:

```bash
xml-mut <XML_MUT_PATH> include --xml-path <XML_PATH>
```

Here `<XML_MUT_PATH>` is a path to your XML mutation file. You can give it `.xmlmut` extension but it is not mandatory so far. `--xml-path` or `-x` argument can be repeated allowing you to include multiple XML files to be mutated. So a call could look something like this:

```bash
xml-mut ~/pref-version-fix.xmlmut include -x ~/code/awesome.csproj -x ~/code/amazing.fsproj
```

## scan command

You can consult how to use the `scan` command with a `help` call:

```bash
xml-mut scan --help
```

The usage is as follows:

```bash
xml-mut <XML_MUT_PATH> scan --extension <EXTENSION> <BASE_PATH>
```

Here `<XML_MUT_PATH>` is a path to your XML mutation file. You can give it `.xmlmut` extension but it is not mandatory so far. `--extension` or `-e` allows specifying what file extensions to include when scanning the directory. You can specify multiple extensions. `<BASE_PATH>` defines a path you want to scan. So a call could look something like this:

```bash
xml-mut ~/pref-version-fix.xmlmut scan -e csproj -e fsproj ~/code
```
48 changes: 3 additions & 45 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,61 +42,19 @@ Your eyes hurt much less looking into XML above 😎. The [syntax](syntax.md) re

## CLI Instalation

Now that you know the language lets put it into use with some CLI. You can install the CLI tool using cargo install. In case you have not installed the Rust language yet [do it](https://www.rust-lang.org/tools/install) first.
Lets put it into use with a [CLI](cli.md). You can install the tool using cargo install. In case you have not installed the Rust language yet [do it](https://www.rust-lang.org/tools/install) first.

```bash
cargo install xml-mut-cli --git https://github.com/tomuxmon/xml-mut
```

Some day it willl be mature enough, and we will be able to ommit the `--git` part.

## CLI Usage Examples

When using CLI you need to supply a path to your XML mutation file. A single XML mutation file can contain multiple mutation definitions. Next, you decide if you want to specify XML files one by one and use the [include command](#include-command) or scan the directory and use the [scan command](#scan-command). You can consult how to use CLI with a `help` call.
You can consult how to use CLI with a `help` call.

```bash
xml-mut --help
```

### include command

You can consult how to use the include command with a `help` call:

```bash
xml-mut include --help
```

The usage is as follows:

```bash
xml-mut <XML_MUT_PATH> include --xml-path <XML_PATH>
```

Here `<XML_MUT_PATH>` is a path to your XML mutation file. You can give it `.xmlmut` extension but it is not mandatory so far. `--xml-path` or `-x` argument can be repeated allowing you to include multiple XML files to be mutated. So a call could look something like this:

```bash
xml-mut ~/pref-version-fix.xmlmut include -x ~/code/awesome.csproj -x ~/code/amazing.fsproj
```

### scan command

You can consult how to use the `scan` command with a `help` call:

```bash
xml-mut scan --help
```

The usage is as follows:

```bash
xml-mut <XML_MUT_PATH> scan --extension <EXTENSION> <BASE_PATH>
```

Here `<XML_MUT_PATH>` is a path to your XML mutation file. You can give it `.xmlmut` extension but it is not mandatory so far. `--extension` or `-e` allows specifying what file extensions to include when scanning the directory. You can specify multiple extensions. `<BASE_PATH>` defines a path you want to scan. So a call could look something like this:

```bash
xml-mut ~/pref-version-fix.xmlmut scan -e csproj -e fsproj ~/code
```
Details are in the [cli docs](cli.md).

## Architexture

Expand Down

0 comments on commit 7a3b857

Please sign in to comment.