@@ -3,8 +3,11 @@ import { FormatResult } from './types'
33const VERSION = require ( '../package.json' ) . version
44
55const indent = ( n : number ) : string => ' ' . repeat ( n * 4 )
6- const log = function ( arg : string , desc : string [ ] , example : string ) : void {
7- console . log ( `\n${ indent ( 1 ) } pack-format ${ arg } ` )
6+ const log = function ( [ argFull , argShort ] : string [ ] , desc : string [ ] , example : string ) : void {
7+ console . log ( '\n' )
8+ console . log ( `${ indent ( 1 ) } ${ argFull } ` )
9+ if ( argShort )
10+ console . log ( `${ indent ( 1 ) } ${ argShort } ` )
811 for ( let i in desc )
912 console . log ( indent ( 2 ) + desc [ i ] )
1013 console . log ( `${ indent ( 3 ) } Example: ${ example } ` )
@@ -25,28 +28,42 @@ const ver = args._[0]
2528// Print the help message
2629if ( args . help ) {
2730 log (
28- '<version>' ,
31+ [
32+ '<version>' ,
33+ ] ,
2934 [ 'Retrieve the resource and data pack formats of any Minecraft version.' ] ,
3035 'pack-format 1.16' ,
3136 )
3237 log (
33- '(--data|-d) <version>' ,
38+ [
39+ '--data <version>' ,
40+ '-d <version>' ,
41+ ] ,
3442 [ 'Retrieve the data pack format only of the version.' ] ,
3543 'pack-format --data 20w45a' ,
3644 )
3745 log (
38- '(--resource|-r) <version>' ,
46+ [
47+ '--resource <version>' ,
48+ '-r <version>' ,
49+ ] ,
3950 [ 'Retrieve the resource pack format only of the version.' ] ,
4051 'pack-format --resource 20w45a' ,
4152 )
4253 log (
43- '(--list|-l) [(--data|-d)|(--resource|-r)] <pack_format>' ,
54+ [
55+ '--list [--data|--resource] <pack_format>' ,
56+ '-l [-d|-r] <pack_format>' ,
57+ ] ,
4458 [ 'Retrieve a list of versions attached to a specific pack format.' , 'Defaults to --resource.' ] ,
4559 'pack-format --list --data 6' ,
4660 )
4761 log (
48- '(--latest|-L) [(--data|-d)|(--resource|-r)]' ,
49- [ 'Retrieve the latest pack formats.' ] ,
62+ [
63+ '--latest [--data|--resource]' ,
64+ '-L [-d|-r]' ,
65+ ] ,
66+ [ 'Retrieve the latest pack formats or version information.' ] ,
5067 'pack-format --latest --resource' ,
5168 )
5269}
@@ -90,6 +107,7 @@ else if (args.latest) {
90107 if ( ! args . data ) {
91108 console . log ( `The latest resource pack format version is ${ LATEST . resource } .` )
92109 }
110+ console . log ( `Data is known up to release ${ LATEST . version } / snapshot ${ LATEST . snapshot } .` )
93111}
94112// Print the pack format of a given version
95113else if ( ver ) {
0 commit comments