Access program args outside of main

Jordan Wilson wilsonjord at gmail.com
Wed Oct 17 22:30:31 UTC 2018


Hello,

Is there a way to access command line arguments outside of main?

// main.d
module main;

import data;
void main(string args[]) {

}

// data.d
module data

immutable programData;
static this() {
     // read in data
}

Ideally, I'd check args before I take the time to load up data.

Thanks,

Jordan



More information about the Digitalmars-d-learn mailing list