Amber icon indicating copy to clipboard operation
Amber copied to clipboard

✨ More built-in commands

Open Ph0enixKM opened this issue 1 year ago • 10 comments

This issue is about implementing the following commands:

  • ~~cd (cd path: Text -> cd path) failable: directory does not exist~~
  • ~~mv (mv a: Text, b: Text -> mv a b) failable: no permissions~~
  • rm (rm path: Text -> rm -rf path) failable: no permissions / file does not exits
  • exit (exit c: Num exit c)

Ph0enixKM avatar Jun 19 '24 08:06 Ph0enixKM

On https://github.com/Ph0enixKM/Amber/pull/185 I added is_root and is_command that I think that should be built-in commands. The second one just check if a command exists.

Mte90 avatar Jun 19 '24 14:06 Mte90

I'm still thinking about that ORM style you suggested. To make such a nice way to compose commands would be a game changer

Ph0enixKM avatar Jun 19 '24 17:06 Ph0enixKM

I think that we need to define built-in should be one shot actions, instead ORM style should be more complex commands with various parameters. The ORM style requires a Class engine in Amber but for that we can discuss in the other ticket.

Mte90 avatar Jun 19 '24 17:06 Mte90

we should also add [[ and [ as builtins for use like if [[ ... ]]

b1ek avatar Jun 28 '24 11:06 b1ek

we should also add [[ and [ as builtins for use like if [[ ... ]]

I think that the [[ and [ commands are the workaround to Bash. We can implement something that makes more sense than this

Ph0enixKM avatar Jul 01 '24 12:07 Ph0enixKM

The ticket is not yet closed as the topic was to add more builtin commands and there was a PR linked that doesn't involve that.

Mte90 avatar Jul 01 '24 16:07 Mte90

Oh sorry @Mte90, I mistook it for a different issue

Ph0enixKM avatar Jul 01 '24 16:07 Ph0enixKM

RIght now we are missing:

  • rm
  • exit

I think that we can add touch too. In this way we have the majority of builtin for our tests.

Maybe @MuhamedMagdi do you want to look on these?

Mte90 avatar Jul 30 '24 13:07 Mte90

Maybe @MuhamedMagdi do you want to look on these?

I'm currently working on rm implementation, but wanted to know how we would approach this feature #369 before opening a pr.

MuhamedMagdi avatar Jul 30 '24 14:07 MuhamedMagdi

For that one I think that we have to wait for @Ph0enixKM.

Mte90 avatar Jul 30 '24 14:07 Mte90