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] filename as first element in args array #357

Closed
shipurjan opened this issue Jul 26, 2024 · 3 comments
Closed

[Feature] filename as first element in args array #357

shipurjan opened this issue Jul 26, 2024 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@shipurjan
Copy link

shipurjan commented Jul 26, 2024

I want to use the filename in a message, but currently filename is not considered an argument

import { len, exit } from "std"

main (args) {
   if len(args) < 1 {
   let filename = args[0]
	echo "Missing branch name"
        echo "Usage: ./{filename} <branch>"
        exit(1)
   }
}

Describe the solution you"d like
I would expect args[0] to always be the filename as is the case in bash with argument $0

@shipurjan shipurjan added the enhancement New feature or request label Jul 26, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Amber Project Jul 26, 2024
@Mte90 Mte90 added the question Further information is requested label Jul 26, 2024
@Mte90
Copy link
Member

Mte90 commented Jul 26, 2024

We are Amber so we do different things, the 0 parameter usually is the script itself.
Let"s see @Ph0enixKM what think about it.

@Ph0enixKM
Copy link
Member

Yes, we are doing the following under the hood args=("$@") that for some reason seems to not include $0. This should be changed to include that

@Ph0enixKM
Copy link
Member

This is a duplicate of #265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants