blob: fbf5b71ad26c73f6f93b99c4767df34555f9b65a [file] [log] [blame]
Matthias Andreas Benkarda1e84432023-12-05 21:12:16 +01001// SPDX-FileCopyrightText: © 2023 Matthias Andreas Benkard <code@mail.matthias.benkard.de>
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5package eu.mulk.jgvariant.tool;
6
7import static java.util.logging.Level.WARNING;
8
9import java.util.logging.Logger;
10import picocli.CommandLine;
11
12/**
13 * A command line tool to read and manipulate GVariant-formatted files.
14 *
Matthias Andreas Benkard61464282024-03-02 13:50:21 +010015 * <p>Implements a tool called {@code jgvariant} that can be used to manipulate GVariant-formatted
16 * files from the command line.
Matthias Andreas Benkard716fc322023-12-12 19:13:01 +010017 *
Matthias Andreas Benkarda1e84432023-12-05 21:12:16 +010018 * <p>Also provides ways to manipulate OSTree repositories.
Matthias Andreas Benkard716fc322023-12-12 19:13:01 +010019 *
20 * <p>Usage example (dumping the contents of an OSTree summary file):
21 *
22 * {@snippet lang="sh" :
23 * $ jgvariant ostree summary read ./jgvariant-ostree/src/test/resources/ostree/summary
24 * }
25 *
26 * <p>Output:
27 *
28 * {@snippet lang="json" :
29 * {
30 * "entries": [
31 * {
32 * "ref": "mulkos/1.x/amd64",
33 * "value": {
34 * "checksum": "66ff167ff35ce87daac817447a9490a262ee75f095f017716a6eb1a9d9eb3350",
35 * "metadata": {
36 * "fields": {
37 * "ostree.commit.timestamp": 1640537170
38 * }
39 * },
40 * "size": 214
41 * }
42 * }
43 * ],
44 * "metadata": {
45 * "fields": {
46 * "ostree.summary.last-modified": 1640537300,
47 * "ostree.summary.tombstone-commits": false,
48 * "ostree.static-deltas": {
49 * "3d3b3329dca38871f29aeda1bf5854d76c707fa269759a899d0985c91815fe6f-66ff167ff35ce87daac817447a9490a262ee75f095f017716a6eb1a9d9eb3350": "03738040e28e7662e9c9d2599c530ea974e642c9f87e6c00cbaa39a0cdac8d44",
50 * "31c8835d5c9d2c6687a50091c85142d1b2d853ff416a9fb81b4ee30754510d52": "f481144629474bd88c106e45ac405ebd75b324b0655af1aec14b31786ae1fd61",
51 * "31c8835d5c9d2c6687a50091c85142d1b2d853ff416a9fb81b4ee30754510d52-3d3b3329dca38871f29aeda1bf5854d76c707fa269759a899d0985c91815fe6f": "2c6a07bc1cf4d7ce7d00f82d7d2d6d156fd0e31d476851b46dc2306b181b064a"
52 * },
53 * "ostree.summary.mode": "bare",
54 * "ostree.summary.indexed-deltas": true
55 * }
56 * }
57 * }
58 * }
Matthias Andreas Benkarda1e84432023-12-05 21:12:16 +010059 */
60public final class Main {
61 static {
62 Logger.getGlobal().setLevel(WARNING);
63 }
64
65 public static void main(String[] args) {
66 int exitCode = new CommandLine(new MainCommand()).execute(args);
67 System.exit(exitCode);
68 }
69
70 private Main() {}
71}