File: version_.d

package info (click to toggle)
sambamba 1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,528 kB
  • sloc: sh: 220; python: 166; ruby: 147; makefile: 103
file content (22 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module utils.version_;

immutable string VERSION = import("VERSION");
immutable string HEADER_VERSION = "1.0"; // goes in header for reproducibility between sambamba versions

import bio.std.hts.sam.header;
import std.array : join;

SamHeader addPG(string tool, string[] args, SamHeader header) {
    auto pg_line = PgLine();
    pg_line.identifier = "sambamba";
    pg_line.command_line = tool ~ " " ~ join(args[1 .. $], " ");
    pg_line.program_version = HEADER_VERSION;

    if (header.programs.length > 0) {
        auto prev_id = header.programs.values.back.identifier;
        pg_line.previous_program = prev_id;
    }

    header.programs.add(pg_line);
    return header;
}