Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] More built-in commands #215

Closed
Ph0enixKM opened this issue Jun 19, 2024 · 10 comments · Fixed by #185 or #402
Closed

[Feature] More built-in commands #215

Ph0enixKM opened this issue Jun 19, 2024 · 10 comments · Fixed by #185 or #402
Labels
enhancement New feature or request syntax

Comments

@Ph0enixKM
Copy link
Member

Ph0enixKM commented Jun 19, 2024

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 Ph0enixKM converted this from a draft issue Jun 19, 2024
@Ph0enixKM Ph0enixKM linked a pull request Jun 19, 2024 that will close this issue
@Mte90
Copy link
Member

Mte90 commented Jun 19, 2024

On #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.

@Ph0enixKM
Copy link
Member Author

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

@Mte90
Copy link
Member

Mte90 commented Jun 19, 2024

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 Mte90 added the enhancement New feature or request label Jun 24, 2024
@b1ek
Copy link
Member

b1ek commented Jun 28, 2024

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

@Ph0enixKM
Copy link
Member Author

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

@github-project-automation github-project-automation bot moved this from 🏃‍♂️ In Progress to 🏁 Done in Amber Project Jul 1, 2024
@Mte90 Mte90 reopened this Jul 1, 2024
@Mte90 Mte90 moved this from 🏁 Done to 📋 Todo in Amber Project Jul 1, 2024
@Mte90
Copy link
Member

Mte90 commented Jul 1, 2024

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.

@Ph0enixKM
Copy link
Member Author

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

This was referenced Jul 15, 2024
MuhamedMagdi added a commit to MuhamedMagdi/amber that referenced this issue Jul 17, 2024
@Mte90 Mte90 added the syntax label Jul 19, 2024
Mte90 pushed a commit that referenced this issue Jul 29, 2024
* feat(builtin): `mv` builtin

Ref: #215

* fix: run tests in `/temp` dir

create file in `/temp` dir then remove it after the test is done

* rename variables

* fix: add `mv` to the know keyword list

* fix: remove exit

* feat: parse command moddifiers

* fix: use unsafe

* fix: use shorter failed syntax

* fix: swap back silent values

* fix: return syntax result
@Mte90
Copy link
Member

Mte90 commented Jul 30, 2024

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?

@MuhamedMagdi
Copy link
Contributor

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.

@Mte90
Copy link
Member

Mte90 commented Jul 30, 2024

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

This was referenced Aug 11, 2024
@Ph0enixKM Ph0enixKM changed the title ✨ More built-in commands [Feature] More built-in commands Sep 16, 2024
@github-project-automation github-project-automation bot moved this from 📋 Todo to 🏁 Done in Amber Project Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request syntax
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants