// use second to last argument if the last one is not an option starting with --
if (!previousArg.startsWith('-') && args.length > 1) {
previousArg = args[args.length - 2];
}
if (!previousArg.startsWith('-')) return; // still no valid arg, abort
const previousArgKey = previousArg.replace(/^-+/, '');