Skip to content

Commit ab996d1

Browse files
authored
Added README docs for toml-query command (#524)
1 parent b2e35f8 commit ab996d1

File tree

6 files changed

+142
-97
lines changed

6 files changed

+142
-97
lines changed

README.md

Lines changed: 110 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,65 @@ Usage: mc-image-helper [-hs] [--debug] [COMMAND]
1414
-h, --help Show this usage and exit
1515
-s, --silent Don't output logs even if there's an error
1616
Commands:
17-
asciify Converts UTF-8 on stdin to ASCII by escaping Unicode
18-
characters
19-
assert Provides assertion operators for verifying container
20-
setup
21-
compare-versions Used for shell scripting, exits with success(0) when
22-
comparison is satisfied or 1 when not
23-
find Specialized replacement for GNU's find
24-
get Download a file
25-
hash Outputs an MD5 hash of the standard input
26-
install-forge Downloads and installs a requested version of Forge
27-
interpolate Interpolates existing files in one or more directories
28-
java-release Outputs the Java release number, such as 8, 11, 17
29-
maven-download Downloads a maven artifact from a Maven repository
30-
modrinth Automates downloading of modrinth resources
31-
patch Patches one or more existing files using JSON path
32-
based operations
33-
sync Synchronizes the contents of one directory to another.
34-
sync-and-interpolate Synchronizes the contents of one directory to another
35-
with conditional variable interpolation.
36-
yaml-path Extracts a path from a YAML file using json-path syntax
37-
vanillatweaks Downloads Vanilla Tweaks resource packs, data packs, or
38-
crafting tweaks given a share code or pack file
17+
asciify Converts UTF-8 on stdin to ASCII by escaping
18+
Unicode characters
19+
assert Provides assertion operators for verifying
20+
container setup
21+
compare-versions Used for shell scripting, exits with success(0)
22+
when comparison is satisfied or 1 when not
23+
curseforge-files Download and manage individual mod/plugin files
24+
from CurseForge
25+
find Specialized replacement for GNU's find
26+
get Download a file
27+
github
28+
hash Outputs an MD5 hash of the standard input
29+
install-curseforge Downloads, installs, and upgrades CurseForge
30+
modpacks
31+
install-fabric-loader Provides a few ways to obtain a Fabric loader with
32+
simple cleanup of previous loader instances
33+
install-forge Downloads and installs a requested version of Forge
34+
install-modrinth-modpack Supports installation of Modrinth modpacks along
35+
with the associated mod loader
36+
install-neoforge Downloads and installs a requested version of
37+
NeoForge
38+
install-paper Installs selected PaperMC
39+
install-purpur Downloads latest or selected version of Purpur
40+
install-quilt Installs Quilt mod loader
41+
interpolate Interpolates existing files in one or more
42+
directories
43+
java-release Outputs the Java release number, such as 8, 11, 17
44+
manage-users
45+
maven-download Downloads a maven artifact from a Maven repository
46+
modrinth Automates downloading of modrinth resources
47+
mcopy Multi-source file copy operation with with managed
48+
cleanup. Supports auto-detected sourcing from
49+
file list, directories, and URLs
50+
network-interfaces Provides simple operations to list network
51+
interface names and check existence
52+
patch Patches one or more existing files using JSON path
53+
based operations
54+
Supports the file formats:
55+
- JSON
56+
- JSON5
57+
- Yaml
58+
- TOML, but processed output is not pretty
59+
resolve-minecraft-version Resolves and validate latest, snapshot, and
60+
specific versions
61+
set-properties Maps environment variables to a properties file
62+
show-all-subcommand-usage Renders all of the subcommand usage as markdown
63+
sections for README
64+
sync Synchronizes the contents of one directory to
65+
another.
66+
sync-and-interpolate Synchronizes the contents of one directory to
67+
another with conditional variable interpolation.
68+
test-logging-levels
69+
toml-path Extracts a path from a TOML file using json-path
70+
syntax
71+
yaml-path Extracts a path from a YAML file using json-path
72+
syntax
73+
vanillatweaks Downloads Vanilla Tweaks resource packs, data
74+
packs, or crafting tweaks given a share code or
75+
pack file
3976
```
4077

4178
For [patch](#patch) command [see below](#patch-schemas) for a description of [PatchSet](#patchset) and [PatchDefinition](#patchdefinition) JSON schemas.
@@ -86,13 +123,12 @@ Usage: mc-image-helper curseforge-files [-h] [--disable-api-caching]
86123
[--mod-loader=<modLoaderType>] [-o=DIR]
87124
[[--api-cache-ttl=OPERATION=DURATION]...
88125
[--api-cache-default-ttl=DURATION]]
89-
[[--connection-pool-max-idle-timeout=DUR
90-
ATION]
126+
[[--http-response-timeout=DURATION]
91127
[--tls-handshake-timeout=DURATION]
92128
[--connection-pool-pending-acquire-timeo
93129
ut=DURATION]
94-
[--http-response-timeout=DURATION]] [REF
95-
[,REF...]...]
130+
[--connection-pool-max-idle-timeout=DURA
131+
TION]] [REF[,REF...]...]
96132
Download and manage individual mod/plugin files from CurseForge
97133
[REF[,REF...]...] Can be <project ID>|<slug>':'<file ID>, <project
98134
ID>|<slug>'@'<filename matcher>, <project
@@ -269,10 +305,9 @@ Usage: mc-image-helper install-curseforge [-h] [--disable-api-caching]
269305
<overridesExclusions>...]]... [[--exclude-include-file=FILE|URI]
270306
[[--exclude-mods=PROJECT_ID|SLUG[,|<ws>PROJECT_ID|SLUG...]]...
271307
[--force-include-mods=PROJECT_ID|SLUG[,|<ws>PROJECT_ID|SLUG...]]...]]
272-
[[--connection-pool-max-idle-timeout=DURATION]
273-
[--tls-handshake-timeout=DURATION]
308+
[[--http-response-timeout=DURATION] [--tls-handshake-timeout=DURATION]
274309
[--connection-pool-pending-acquire-timeout=DURATION]
275-
[--http-response-timeout=DURATION]]
310+
[--connection-pool-max-idle-timeout=DURATION]]
276311
[[--api-cache-ttl=OPERATION=DURATION]...
277312
[--api-cache-default-ttl=DURATION]] [COMMAND]
278313
Downloads, installs, and upgrades CurseForge modpacks
@@ -407,11 +442,12 @@ Usage: mc-image-helper install-forge [-h] [--force-reinstall]
407442
[--results-file=FILE]
408443
[--forge-installer=<installer> |
409444
[--forge-version=<version>]]
410-
[[--connection-pool-max-idle-timeout=DURATI
411-
ON] [--tls-handshake-timeout=DURATION]
445+
[[--http-response-timeout=DURATION]
446+
[--tls-handshake-timeout=DURATION]
412447
[--connection-pool-pending-acquire-timeout=
413448
DURATION]
414-
[--http-response-timeout=DURATION]]
449+
[--connection-pool-max-idle-timeout=DURATIO
450+
N]]
415451
Downloads and installs a requested version of Forge
416452
--connection-pool-max-idle-timeout=DURATION
417453
@@ -455,11 +491,10 @@ Usage: mc-image-helper install-modrinth-modpack [--force-modloader-reinstall]
455491
[--ignore-missing-files=<ignoreMissingFiles>[,
456492
|<nl><ignoreMissingFiles>...]]...
457493
[--overrides-exclusions=<overridesExclusions>[NL or ,
458-
<overridesExclusions>...]]...
459-
[[--connection-pool-max-idle-timeout=DURATION]
494+
<overridesExclusions>...]]... [[--http-response-timeout=DURATION]
460495
[--tls-handshake-timeout=DURATION]
461496
[--connection-pool-pending-acquire-timeout=DURATION]
462-
[--http-response-timeout=DURATION]]
497+
[--connection-pool-max-idle-timeout=DURATION]]
463498
Supports installation of Modrinth modpacks along with the associated mod loader
464499
--api-base-url=<baseUrl>
465500
Default: https://api.modrinth.com
@@ -531,12 +566,12 @@ Usage: mc-image-helper install-neoforge [-h] [--force-reinstall]
531566
[--neoforge-version=<version>]
532567
[--output-directory=DIR]
533568
[--results-file=FILE]
534-
[[--connection-pool-max-idle-timeout=DUR
535-
ATION]
569+
[[--http-response-timeout=DURATION]
536570
[--tls-handshake-timeout=DURATION]
537571
[--connection-pool-pending-acquire-timeo
538572
ut=DURATION]
539-
[--http-response-timeout=DURATION]]
573+
[--connection-pool-max-idle-timeout=DURA
574+
TION]]
540575
Downloads and installs a requested version of NeoForge
541576
--connection-pool-max-idle-timeout=DURATION
542577
@@ -571,11 +606,12 @@ Usage: mc-image-helper install-paper [--check-updates] [--base-url=<baseUrl>]
571606
| [[--project=<project>] [--build=<build>]
572607
[--channel=<channel>]
573608
[--version=<version>]]]
574-
[--connection-pool-max-idle-timeout=DURATIO
575-
N | [--tls-handshake-timeout=DURATION] |
609+
[[--http-response-timeout=DURATION] |
610+
[--tls-handshake-timeout=DURATION] |
576611
--connection-pool-pending-acquire-timeout=D
577612
URATION |
578-
[--http-response-timeout=DURATION]]
613+
--connection-pool-max-idle-timeout=DURATION
614+
]
579615
Installs selected PaperMC
580616
--base-url=<baseUrl>
581617
--build=<build>
@@ -610,11 +646,12 @@ Usage: mc-image-helper install-purpur [--base-url=<baseUrl>]
610646
[--url=<downloadUrl> |
611647
[[--version=<version>]
612648
[--build=<build>]]]
613-
[--connection-pool-max-idle-timeout=DURATI
614-
ON | [--tls-handshake-timeout=DURATION] |
649+
[[--http-response-timeout=DURATION] |
650+
[--tls-handshake-timeout=DURATION] |
615651
--connection-pool-pending-acquire-timeout=
616652
DURATION |
617-
[--http-response-timeout=DURATION]]
653+
--connection-pool-max-idle-timeout=DURATIO
654+
N]
618655
Downloads latest or selected version of Purpur
619656
--base-url=<baseUrl>
620657
--build=<build>
@@ -646,11 +683,12 @@ Usage: mc-image-helper install-quilt [-h] [--force-reinstall]
646683
[--repo-url=<repoUrl>]
647684
[--results-file=FILE] [--installer-url=URL
648685
| --installer-version=VERSION]
649-
[[--connection-pool-max-idle-timeout=DURATI
650-
ON] [--tls-handshake-timeout=DURATION]
686+
[[--http-response-timeout=DURATION]
687+
[--tls-handshake-timeout=DURATION]
651688
[--connection-pool-pending-acquire-timeout=
652689
DURATION]
653-
[--http-response-timeout=DURATION]]
690+
[--connection-pool-max-idle-timeout=DURATIO
691+
N]]
654692
Installs Quilt mod loader
655693
--connection-pool-max-idle-timeout=DURATION
656694
@@ -722,12 +760,12 @@ Usage: mc-image-helper manage-users [-fh] [--existing=<existingFileBehavior>]
722760
>] -t=<type>
723761
[--user-api-provider=<userApiProvider>]
724762
[--version=<version>]
725-
[[--connection-pool-max-idle-timeout=DURATIO
726-
N] [--tls-handshake-timeout=DURATION]
763+
[[--http-response-timeout=DURATION]
764+
[--tls-handshake-timeout=DURATION]
727765
[--connection-pool-pending-acquire-timeout=D
728766
URATION]
729-
[--http-response-timeout=DURATION]] [INPUT[,
730-
INPUT...]...]
767+
[--connection-pool-max-idle-timeout=DURATION
768+
]] [INPUT[,INPUT...]...]
731769
[INPUT[,INPUT...]...] One or more Mojang usernames, UUID, or ID (UUID
732770
without dashes); however, when offline, only
733771
UUID/IDs can be provided.
@@ -770,11 +808,12 @@ Usage: mc-image-helper maven-download [-h] [--print-filename] [--skip-existing]
770808
[--output-directory=<outputDirectory>]
771809
[--packaging=<packaging>]
772810
[-r=<mavenRepo>] [-v=<version>]
773-
[[--connection-pool-max-idle-timeout=DURAT
774-
ION] [--tls-handshake-timeout=DURATION]
811+
[[--http-response-timeout=DURATION]
812+
[--tls-handshake-timeout=DURATION]
775813
[--connection-pool-pending-acquire-timeout
776814
=DURATION]
777-
[--http-response-timeout=DURATION]]
815+
[--connection-pool-max-idle-timeout=DURATI
816+
ON]]
778817
Downloads a maven artifact from a Maven repository
779818
-a, -m, --module, --artifact=<artifact>
780819
@@ -842,10 +881,11 @@ Usage: mc-image-helper modrinth [--skip-existing] [--skip-up-to-date]
842881
[--output-directory=DIR]
843882
[--world-directory=<worldDirectory>]
844883
[--projects=id|slug[,|<nl>id|slug...]]...
845-
[[--connection-pool-max-idle-timeout=DURATION]
884+
[[--http-response-timeout=DURATION]
846885
[--tls-handshake-timeout=DURATION]
847886
[--connection-pool-pending-acquire-timeout=DURAT
848-
ION] [--http-response-timeout=DURATION]]
887+
ION]
888+
[--connection-pool-max-idle-timeout=DURATION]]
849889
Automates downloading of modrinth resources
850890
--allowed-version-type=<defaultVersionType>
851891
Valid values: release, beta, alpha
@@ -914,10 +954,9 @@ Supports the file formats:
914954

915955
```
916956
Usage: mc-image-helper resolve-minecraft-version
917-
[[--connection-pool-max-idle-timeout=DURATION]
918-
[--tls-handshake-timeout=DURATION]
957+
[[--http-response-timeout=DURATION] [--tls-handshake-timeout=DURATION]
919958
[--connection-pool-pending-acquire-timeout=DURATION]
920-
[--http-response-timeout=DURATION]] <inputVersion>
959+
[--connection-pool-max-idle-timeout=DURATION]] <inputVersion>
921960
Resolves and validate latest, snapshot, and specific versions
922961
<inputVersion>
923962
--connection-pool-max-idle-timeout=DURATION
@@ -1001,6 +1040,14 @@ interpolation.
10011040
Usage: mc-image-helper test-logging-levels
10021041
```
10031042

1043+
### toml-path
1044+
1045+
```
1046+
Usage: mc-image-helper toml-path query [file]
1047+
query JSON path expression where root element $ can be omitted
1048+
[file] TOML file or reads stdin
1049+
```
1050+
10041051
### vanillatweaks
10051052

10061053
```
@@ -1010,11 +1057,12 @@ Usage: mc-image-helper vanillatweaks [--force-synchronize]
10101057
[--world-subdir=<worldSubdir>]
10111058
[--pack-files=FILE[,|<nl>FILE...]]...
10121059
[--share-codes=CODE[,|<nl>CODE...]]...
1013-
[[--connection-pool-max-idle-timeout=DURATI
1014-
ON] [--tls-handshake-timeout=DURATION]
1060+
[[--http-response-timeout=DURATION]
1061+
[--tls-handshake-timeout=DURATION]
10151062
[--connection-pool-pending-acquire-timeout=
10161063
DURATION]
1017-
[--http-response-timeout=DURATION]]
1064+
[--connection-pool-max-idle-timeout=DURATIO
1065+
N]]
10181066
Downloads Vanilla Tweaks resource packs, data packs, or crafting tweaks given a
10191067
share code or pack file
10201068
--base-url=<baseUrl>

src/main/java/me/itzg/helpers/McImageHelper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
import me.itzg.helpers.errors.ExceptionHandler;
2121
import me.itzg.helpers.errors.ExitCodeMapper;
2222
import me.itzg.helpers.fabric.InstallFabricLoaderCommand;
23-
import me.itzg.helpers.files.TomlQueryCommand;
23+
import me.itzg.helpers.files.TomlPathCommand;
24+
import me.itzg.helpers.files.YamlPathCommand;
2425
import me.itzg.helpers.find.FindCommand;
2526
import me.itzg.helpers.forge.InstallForgeCommand;
2627
import me.itzg.helpers.forge.InstallNeoForgeCommand;
@@ -38,7 +39,6 @@
3839
import me.itzg.helpers.singles.HashCommand;
3940
import me.itzg.helpers.singles.NetworkInterfacesCommand;
4041
import me.itzg.helpers.singles.TestLoggingCommand;
41-
import me.itzg.helpers.singles.YamlPathCmd;
4242
import me.itzg.helpers.sync.InterpolateCommand;
4343
import me.itzg.helpers.sync.MulitCopyCommand;
4444
import me.itzg.helpers.sync.Sync;
@@ -92,8 +92,8 @@
9292
Sync.class,
9393
SyncAndInterpolate.class,
9494
TestLoggingCommand.class,
95-
TomlQueryCommand.class,
96-
YamlPathCmd.class,
95+
TomlPathCommand.class,
96+
YamlPathCommand.class,
9797
VanillaTweaksCommand.class,
9898
}
9999
)

0 commit comments

Comments
 (0)