Additional command line switches for some region based commands.
streppa opened this issue ยท 1 comments
Some proposed changes to the following commands:
- //paste
- //move
- //stack
Usage: //paste [-a] [-o] [-s] [-v ALT] [DIR] Paste the region that is currently stored in the clipboard. Where the selection is pasted will be based on the relative block on which the character was standing when the region was selected. The relative direction of the region will also remain unless modified by the DIR argument and '-v' switch. The supported values for DIR are north, south, east, or west. -a Do not include air blocks when pasting region in clipboard. -o Paste the region in the clipboard at its origin. -s Automatically select pasted region. -v ALT Can be used alone or in conjunction with '-d' to paste the selection above or below the current character. (too much?)
Usage: //stack [-a] [-i|s] AMOUNT [DIR] Stack the currently selected region by AMOUNT in the direction specified by the optional DIR argument. If no DIR is specified the stack will be performed in the direction the player is facing. The DIR argument can be any one of the cardinal directions, i.e., north, south, east, and west; or, up and down. The default behavior is to keep the selection as is. -a When stacking the selected region ignore the air blocks in the selection. -i After the stack is finished add the newly created blocks into the current region selection. The '-s' switch is implied and its use is redundant in conjunction with '-i'. -s Once the stack is complete automaticaly select only the newly created blocks. The old region will no longer be selected.
Usage: //move [-f BLOCK_ID] [-s] DISTANCE [DIR] Move the selected region DISTANCE blocks in the direction specified by DIR. If DIR is omitted the direction the player is facing is used. DIR can be any one of north, south, east, west, up, or down. Unless otherwise designated by the '-f' switch the moved selection will leave behind 'air' (id:0) blocks. -f BLOCK_ID Replace the moved region with BLOCK_ID. The default block is 'air' (id:0). -s Change the selected region to coincide with the new location of the moved region.
As far as dealing with switch arguments it looks like the Apache Foundation has a command line parser for Java similiar to C's GetOpt library. Presumably it's under the Apache License. Not sure what WorldEdit is using so maybe this will be useful. I like the command switch paradigm but implementing it on ones own just sucks. Maybe Bukkit itself should implement a GetOpt like parser. Hmmm... =)