romibi / Scrap-Packed-Explorer

With this App it is planned to make it userfriendly to create a new or modify the contents of an existing .packed file for the Game Scrapland.
MIT License
3 stars 3 forks source link

Added `cat` feature #24

Closed Strongleong closed 2 years ago

Strongleong commented 2 years ago

Implemented feature #23.

New keyword: cat

Prints content of specified file inside of container. Can output as raw text or in hexdump format

Help screen:

$ ScrapPackedExplorerCli.exe help cat
ScrapPackedExplorerCli 0.2.0.0
Copyright (C) 2022 romibi
USAGE:
  ScrapPackedExplorerCli.exe <path-to-packed-file> <subcommand> <options>
EXAMPLE:
  ScrapPackedExplorerCli.exe example.packed list -osq filename.txt -l tree

  Packed file (pos. 0)         Required. The .packed file to use as basis
  -s, --packedPath             Required. (Default: ) What file to print
  -x, --asHex                  (Default: false) Display file content as hex dump
  -f, --byteFormat             (Default: X2) Format of printed bytes
  -l, --LineFormat             (Default: X8) Format of lines numbers
  -g, --bytesPerGroup          (Default: 2) How much bytes should print before printing space
  -r, --groupsPerRow           (Default: 16) How much groups should print in one line
  -p, --noPrintLinesNumbers    (Default: false) Do not print lines numbers
  --help                       Display this help screen.
  --version                    Display version information.

Usage example (from tests):

$ ScrapPackedExplorerCli.exe example.packed cat -s file2.txt -x -g 2 -r 20 -f d3 -l d3
000 066101 103105 110032 111102 032116 104101 032115 101099 111110 100032
020 102105 108101 032105 110032 116104 101032 101120 097109 112108 101032
040 112097 099107 101100 032097 114099 104105 118101 046013 010065 103097
060 105110 032116 104101 032099 111110 116101 110116 032105 115032 110111
080 116032 114101 108101 118097 110116 046013 010070 111114 032101 097115
100 105101 114032 097110 097121 122101 032097 108108 032116 101120 116102
120 105108 101115 032115 116097 114116 032119 105116 104032 066032 101032
140 103032 105032 110032 097110 100032 101032 110032 100032 119105 116104
160 032046 046046 013010 069078 068

All possible formats can be found here

romibi commented 2 years ago

Merged master into this branch (What a horrible merge!) Also fixed most Code Style Messages …

Wasn't in the mood to think much about if the amount of Bits are important for the remaining few Int32 and Int16 "Name can be simplified" messages. Please change that or supress messages via attribute accordingly …

Also I fixed Tests as archives are now containers.

Once the remaining Code-Style messages are resolved this can be merged. Unless of course you have some reason to wait with a merge.