-
Notifications
You must be signed in to change notification settings - Fork 391
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
Improve gno run
#930
Comments
Starting with the implementation of the first enhancement (os.Args). |
I refactored the
I'm having some problems injecting the Args into a var inside a package, waiting for #859 which should make the process simpler. If someone has some insights about how to move forward, I'd be willing to chat with you about it. |
Do you already have a PR for your work? can you share, the link? |
@moul I don't. Because I wasn't able to make it work, I just discarded the changes. I can recreate and add them to a draft PR. |
Yes please, a draft PR may be useful to help you. |
I have a question how is the arguments will be parsed ? gno run main.gno hello I get gno run main.gno --args="Hello World" or put the files under a flag gno run --files="main.gno test.gno" Hello World |
I discussed with @moul how to have os.Args in a "nice" way. Thanks for your contribution @salihdhaifullah, but actually direct access to os.Args is a non-goal. Essentially we want So, we're thinking of changing the functioning of
instead of supporting multiple file arguments. Then, if arguments are passed, they are given in to the main function; in a fashion similar to what we have for
func main(arg1, arg2 string) {
println(arg1, arg2)
} will print |
The
gno run
command is presently in a pre-alpha phase and may not perform reliably due to its specific requirements for package and function naming.Its primary objective is to facilitate a smooth transition for developers from Go by allowing them to start with a basic main function. Additionally, it aims to provide utility tools for those who are forking or reviewing a package.
To enhance its usability and commence documentation in guides, two primary enhancements are urgently needed:
os.Args
, enabling more dynamic results from a single main function based on various parameters.package PKGPATH
specification, making it easier to add a main function and executegno run
on a package without having to specify a file (related to issue Allow *_test.gno file to run pkg with _test as suffix #768).Addresses #972
The text was updated successfully, but these errors were encountered: