const { Command } = require('commander') const { version } = require('../package.json') const { fetchRemote } = require('./remote') const { fetchTags } = require('./tags') const { parseReleases } = require('./releases') const { compileTemplate } = require('./template') const { parseLimit, readFile, readJson, writeFile, fileExists, updateLog, formatBytes } = require('./utils') const DEFAULT_OPTIONS = { output: 'CHANGELOG.md', template: 'compact', remote: 'origin', commitLimit: 3, backfillLimit: 3, tagPrefix: '', sortCommits: 'relevance', appendGitLog: '', appendGitTag: '', config: '.auto-changelog' } const PACKAGE_FILE = 'package.json' const PACKAGE_OPTIONS_KEY = 'auto-changelog' const PREPEND_TOKEN = '' const getOptions = async argv => { const commandOptions = new Command() .option('-o, --output ', `output file, default: ${DEFAULT_OPTIONS.output}`) .option('-c, --config ', `config file location, default: ${DEFAULT_OPTIONS.config}`) .option('-t, --template