Skip to content

Direct access to ARGV #5

@bb

Description

@bb

It is currently possible to access the command line arguments when writing a Duby script like this

class MyClass
  def self.main(args:String[])
     puts args
  end
end

But it's not possible to use ARGV like it is in Ruby. This script will currently fail:

puts ARGV

It would be cool if ARGV would be available outside explicitly declared classes.
In the generated java code, args is available at the moment, but at compile time, the type of args cannot be inferred. I guess it could be enough to globally declare args as String[] but I prefer the usage of ARGV outside of an explicit main method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions