TIC-80 icon indicating copy to clipboard operation
TIC-80 copied to clipboard

Add basic file management to the Console

Open PibePlayer opened this issue 8 years ago • 3 comments

I would like to see working cp, mv, rm commands on the command line

PibePlayer avatar Sep 11 '17 19:09 PibePlayer

I'd love to work on this -- but I am not sure where to find the relevant code. Anyone know?

trevortomesh avatar Mar 17 '18 02:03 trevortomesh

@trevortomesh take a look at https://github.com/nesbox/TIC-80/blob/master/src/console.c.

The line https://github.com/nesbox/TIC-80/blob/master/src/console.c#L2357 lists the available commands, and each of them is associated to a console method. I guess you just have to do the same for your commands.

You can read the following methods that might help you writting your own:

  • onConsoleDirCommand - when user types dir or ls it displays the files in the current directory - https://github.com/nesbox/TIC-80/blob/master/src/console.c#L1292
  • onConsoleMakeDirectory - when user types mkdir and creates a new directory - https://github.com/nesbox/TIC-80/blob/master/src/console.c#L1283
  • onConsoleDelCommand - when the user types del and deletes a cart - https://github.com/nesbox/TIC-80/blob/master/src/console.c#L2238

Good luck o/

frenetic avatar Mar 19 '18 01:03 frenetic

I would like to see working cp, mv, rm commands on the command line

This would be a great feature

rodigu avatar May 29 '24 17:05 rodigu