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

[Bug] Main args do not expand to all arguments #265

Closed
1 of 2 tasks
Ph0enixKM opened this issue Jul 2, 2024 · 5 comments
Closed
1 of 2 tasks

[Bug] Main args do not expand to all arguments #265

Ph0enixKM opened this issue Jul 2, 2024 · 5 comments
Assignees
Labels
bug Something isn't working compiler enhancement New feature or request

Comments

@Ph0enixKM
Copy link
Member

Ph0enixKM commented Jul 2, 2024

the args in the main block does not include the binary name. It seems that Bash developers chose to not include $0 in the $@. What to do:

  • Change generated bash args=("$@") to args=("$0" "$@")
  • Update the documentation that args are the full arguments including the caller
@Ph0enixKM Ph0enixKM changed the title Main args do not expand to all arguments 🐞 Main args do not expand to all arguments Jul 2, 2024
@rbtylee
Copy link

rbtylee commented Jul 2, 2024

Perhaps we could leave args in amber as it is and add a function in std or another library that supplies the script name (ie $0).

@Ph0enixKM
Copy link
Member Author

@rbtylee Do you think that this would be too dramatic of a change? Perhaps for the skilled Bash developers this would be an anomaly to add $0 to the argument array. For most of the programming languages the args array start with the $0.

@rbtylee
Copy link

rbtylee commented Jul 2, 2024

@Ph0enixKM, I suppose I am thinking more in terms of backward compatibility. But considering the lack of much significant Amber code backward compatibility does not really matter much. And you raise a fair point.

@Ph0enixKM
Copy link
Member Author

@rbtylee Since Amber is in it's early alpha stage I think that this is the best moment to introduce some of the breaking changes

@Mte90 Mte90 added enhancement New feature or request bug Something isn't working labels Jul 3, 2024
@Ph0enixKM Ph0enixKM changed the title 🐞 Main args do not expand to all arguments [Bug] Main args do not expand to all arguments Jul 7, 2024
@Mte90 Mte90 added the compiler label Jul 19, 2024
@Ph0enixKM Ph0enixKM added this to the Amber 0.4.0-alpha milestone Jul 26, 2024
@b1ek b1ek self-assigned this Jul 30, 2024
Mte90 added a commit that referenced this issue Aug 1, 2024
@Mte90
Copy link
Member

Mte90 commented Aug 5, 2024

Closing as the code it's there and for the documentation we have a different repository that has to align with all the stuff.

amber-lang/amber-docs#34

@Mte90 Mte90 closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants