function handleSingleFile(currentOptions, filename) {
    try {
        const sourceExt = path.extname(filename)
        let outputFilename
        if (sourceExt === '.rt') {
            outputFilename = filename + (currentOptions.modules === 'typescript' ? '.ts' : '.js')
        } else if (sourceExt === '.jsrt') {
            outputFilename = filename.replace(/\.jsrt$/, '.js')
            currentOptions = _.assign({}, currentOptions, {modules: 'jsrt'})
        } else if (sourceExt === '.rts') {
            outputFilename = `${filename}.js`
            currentOptions = _.assign({}, currentOptions, {modules: 'rts'})
        } else {
            context.error('invalid file, only handle rt/jsrt files', filename)
            return
        }
        api.convertFile(filename, outputFilename, currentOptions, context)
    } catch (e) {
        context.error(e.message, filename, e.line, e.column, e.startOffset, e.endOffset)
    }
}
/*.rt`, {cwd: context.cwd});
        //     }
        //     return fp;
        // });
        const allFiles = _.flatMap(files, f => glob.sync(f, {cwd: context.cwd}))
        // console.log(allFiles.length);
        _.forEach(allFiles, handleSingleFile.bind(this, currentOptions))
        ret = shell.printResults(context)
    } else {
        console.log(options.generateHelp())
    }
    return ret
}

function printVersions(currentOptions) {
    const ret = Object.keys(reactDOMSupport)
    if (currentOptions.format === 'json') {
        console.log(JSON.stringify(ret, undefined, 2))
    } else {
        console.log(ret.join(', '))
    }
}

/**
@param {Options} currentOptions
@param {string} filename file name to process