How to use the pil function from yargs

Find comprehensive JavaScript yargs.pil code examples handpicked from public code repositorys.

9
10
11
12
13
14
15
16
17
18
19
20
    .alias("c", "const")
    .argv;


async function main(){
    let Fr = new F1Field("0xFFFFFFFF00000001");
    const pilFile = typeof(argv.pil) === "string" ?  argv.pil.trim() : "pil/main.pil";
    const pilConfig = typeof(argv.pilconfig) === "string" ? JSON.parse(fs.readFileSync(argv.pilconfig.trim())) : {};


    const pil = await compile(Fr, pilFile, null, pilConfig);
    const pilDeg = Object.values(pil.references)[0].polDeg;
fork icon7
star icon29
watch icon0

+ 3 other calls in file

49
50
51
52
53
54
55
56
57
58
let pilFile = __dirname + "/../pil/main.pil";
if (argv.pil) {
    if (typeof(argv.pil) !== "string") {
        throw new Error("Pil file needs to be specified with pil option")
    }
    pilFile = argv.pil.trim();
}
console.log('compile PIL '+pilFile);

const pilConfig = typeof(argv.pilconfig) === "string" ? JSON.parse(fs.readFileSync(argv.pilconfig.trim())) : {};
fork icon7
star icon29
watch icon0

+ 3 other calls in file

52
53
54
55
56
57
58
59
60
61

let pil;
if (typeof(argv.pilJson) === "string") {
    pil = JSON.parse(fs.readFileSync(argv.pilJson.trim()));
} else {
    const pilFile = typeof(argv.pil) === "string" ?  argv.pil.trim() : "main.pil";
    pil = await compile(F, pilFile, null, config);
}

const n = pil.references[Object.keys(pil.references)[0]].polDeg;
fork icon6
star icon26
watch icon0

+ 6 other calls in file

34
35
36
37
38
39
40
41
42
43
} else  {
    console.log("Only one commit file at a time is permited");
    process.exit(1);
}

const pilFile = typeof(argv.pil) === "string" ?  argv.pil.trim() : "main.pil.json";
const publics = typeof(argv.publics) === "string" ?  JSON.parse(fs.readFileSync(argv.publics.trim())) : false;
const constantFile = typeof(argv.constant) === "string" ?  argv.constant.trim() : "constant.bin";

const config = typeof(argv.config) === "string" ? JSON.parse(fs.readFileSync(argv.config.trim())) : {};
fork icon6
star icon24
watch icon4

+ 2 other calls in file

Other functions in yargs

Sorted by popularity

function icon

yargs.argv is the most popular function in yargs (1012 examples)