cli.js
function (env) {

    console.log('Stubbatti server version %s.', Stubbatti.version);

    // If `-h` or `--help` option is specified then it shows the help messages and exits.
    if (argv.help || argv.h) {
        showHelp();

        return;
    }

    if (!env.configPath) {
        console.log('Error: `stubbatti` file not found.');
        console.log('see %s', homepage);

        return;
    }

    console.log('Loading %s.', env.configPath);

    // load user defined stubbatti file
    require(env.configPath);

    // If `--kill` option is specified then it doesn't launch a stub server but kills the existing sevrer.
    if (argv.kill) {
        stubbatti.killExistingServer();

        return;
    }

    // launch a stub server
    stubbatti.start();
}
function (env) {

    console.log('Stubbatti server version %s.', Stubbatti.version);

    // If `-h` or `--help` option is specified then it shows the help messages and exits.
    if (argv.help || argv.h) {
        showHelp();

        return;
    }

    if (!env.configPath) {
        console.log('Error: `stubbatti` file not found.');
        console.log('see %s', homepage);

        return;
    }

    console.log('Loading %s.', env.configPath);

    // load user defined stubbatti file
    require(env.configPath);

    // If `--kill` option is specified then it doesn't launch a stub server but kills the existing sevrer.
    if (argv.kill) {
        stubbatti.killExistingServer();

        return;
    }

    // launch a stub server
    stubbatti.start();
}
main