An open API service indexing awesome lists of open source software.

https://github.com/cms-l1-globaltrigger/tm-diff

Convenient data comparison for XML trigger menus
https://github.com/cms-l1-globaltrigger/tm-diff

cern cms-l1-dpg lhc scientific

Last synced: 5 months ago
JSON representation

Convenient data comparison for XML trigger menus

Awesome Lists containing this project

README

          

XML Menu Diff
=============

## Install

```bash
pip install --extra-index-url https://globaltrigger.web.cern.ch/pypi tm-diff
```

## Basic usage

Compare the content of two XML trigger menus.

```bash
tm-diff [-f|--format ] [-s|--skip ] [--sort ]
[-d|--dump] [-o ]

```

### Format

Use flag `-f|--format ` to select diff output format. Options are:

* `unified` for unified diff format
* `context` for contextual diff format
* `html` for a complete diff in as HTML file
* `report` to be copy-pasted into TWiki reports

Default format is `unified`.

**Example:**

```bash
tm-diff ... -fhtml -o diff.html # dumps diff as HTML table to file
```

### Skip

Use flag `-s|--skip ` to ignore certain attributes. Options are

* `module` to skip implementation details (attributes `uuid_firmware`, `n_modules`, `module_id`, `module_index`)
* `comment` to skip comments (attribute `comment`)
* `labels` to skip algorithm labels (attribute `labels`)

**Example:**

```bash
tm-diff ... -smodule -scomment # ignores module_is/index and any comments
```

### Sort

Use flag `--sort ` to sort algorithms by attribute. Options are

* `index` to sort by algorithm index
* `name` to sort by algorithm name
* `expression` to sort by algorithm expression

Default sort kay is `index`.

### Dump

Use flag `-d|--dump` to dump the raw text used to diff the menu contents. This
option will create two text files with the menu names at the current working location.

**Example:**

```bash
tm-diff foo.xml bar.xml -d # dumps raw text to foo.xml.txt bar.xml.txt
```

### Output

Use flag `-o ` to write the output to a file.

**Example:**

```bash
tm-diff foo.xml bar.xml -o diff.txt # write output to file
```

This is equivalent to:

```bash
tm-diff foo.xml bar.xml > diff.txt # pipe stdout to file
```