Truffle CLI exec with arguments
const argv = require('yargs-parser')(process.argv.slice(2)); /** * Usage: `truffle exec hello.js -n=Dung [--network <name>] [--compile]`, */ module.exports = async (callback) => { let name = argv?.n || 'World!'; callback(`Hello ${name}`); };