{"size": 1079, "ext": "js", "max_stars_repo_path": "src/cli/index.js", "max_stars_repo_name": "grupoboticario/news-fragments", "max_stars_repo_stars_event_min_datetime": "2020-02-17T23:54:51.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-14T08:15:54.000Z", "max_issues_repo_path": "src/cli/index.js", "max_issues_repo_name": "grupoboticario/news-fragments", "max_issues_repo_issues_event_min_datetime": "2020-02-18T01:19:47.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-07T11:53:10.000Z", "max_forks_repo_path": "src/cli/index.js", "max_forks_repo_name": "grupoboticario/news-fragments", "max_forks_repo_forks_event_min_datetime": "2020-03-30T11:19:48.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-14T10:37:23.000Z"}
{"max_stars_count": 28, "max_issues_count": 293, "max_forks_count": 6, "avg_line_length": 20.75, "max_line_length": 64, "alphanum_fraction": 0.5875810936}
#!/usr/bin/env node

"use strict";
const { pathToFileURL } = require("url");
const { create } = require("./create");
const { preview } = require("./preview");
const { burn } = require("./burn");

import('meow').then(meow => {  // eslint-disable-line
  const cli = meow.default(
    `
	Usage
    $ news-fragments create <fragment-type> <fragment-text>
    $ news-fragments preview
    $ news-fragments preview -p <previous-version>
    $ news-fragments burn <version>

  Options
    --help

	Examples
    $ news-fragments create feature "New feature"
    $ news-fragments burn 0.0.1
    $ news-fragments preview
    $ news-fragments preview -p 0.0.1
`,
    {
      importMeta: { url: pathToFileURL(__filename).toString() },
      flags: {
        previousVersion: {
          type: "string",
          alias: "p",
        },
      },
    }
  );

  const commands = {
    create: create,
    preview: preview,
    burn: burn,
  };

  const command = commands[cli.input[0]];

  if (command !== undefined) {
    command(cli.input, cli.flags);
  } else {
    cli.showHelp(0);
  }
});
