Querz / mcaselector

A tool to select chunks from Minecraft worlds for deletion or export.
MIT License
3.17k stars 177 forks source link

Quotation marks in CLI parameters are incorrectly parsed in Pterodactyl panels #394

Closed accLarson closed 1 year ago

accLarson commented 1 year ago

Describe the bug I'm hesitant to submit this bug report since it's really not an mcaselector issue but more so a pterodacyl issue, however, it could be solved by a small fix to mcaselector. Hopefully this is helpful information.

When attempting to run mcaselector.jar via pterodactyl panel, the --query parameter is parsed incorrectly. The shell is not friendly with the quotation marks required for specifying a query. An example:

container@pterodactyl~ java -jar mca.jar --mode delete --world world --query "InhabitedTime < 30s"
error: failed to parse query: invalid filter type ""InhabitedTime" at: "InhabitedTime<--[HERE]

As you can see, the shell is reading the filter as "InhabitedTime instead of InhabitedTime (quotation mark is being read as part of the filter)

I speculate this error will occur with any parameter that requires quotation marks.

The above jar startup works correctly in a windows 11 command prompt environment.

To Reproduce Steps to reproduce the behavior:

  1. Establish a pterodactyl panel environment (eg. BloomHost)
  2. Run java -jar mca.jar --mode delete --world world --query "InhabitedTime < 30s"
  3. observe the error.

Expected behavior java -jar mca.jar --mode delete --world world --query "InhabitedTime < 30s" trims the world.

My suggestion and plea is for mcaselector to support at least one of the following or similar:

  1. Some character which can be used in place of spaces for parsing parameters without quotes. java -jar mca.jar --mode delete --world world --query InhabitedTime~<~30s
  2. Allow --query to read from a text file for parsing parameters without quotes. java -jar mca.jar --mode delete --world world --query myfile.txt

Environment (please complete the following information):

Additional context The beginning of my reporting this issue in discord: https://discord.com/channels/722924391805223113/722925054882742412/979424362656595968

scroll to see conversation with @summerdrive and @Querz

accLarson commented 1 year ago

Issue fixed by mcaselector, pterodactyl may still need to correct the root of the issue.

https://github.com/Querz/mcaselector/releases/tag/2.2