Skip to content

Instantly share code, notes, and snippets.

@brandongregoryscott
Last active June 13, 2020 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandongregoryscott/af92aa668c87804cfc722409ecd462f8 to your computer and use it in GitHub Desktop.
Save brandongregoryscott/af92aa668c87804cfc722409ecd462f8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
// -----------------------------------------------------------------------------------------
// #region Imports
// -----------------------------------------------------------------------------------------
const program = require("commander");
// #endregion Imports
// -----------------------------------------------------------------------------------------
// #region Entrypoint / Command router
// -----------------------------------------------------------------------------------------
// Description to display to the user when running the cli without arguments
program.description("Example cli written using ShellJS and Commander");
// Registers the dotnet command via 'cli-dotnet.js' in the same folder. Commands must be created
// in a file prefixed with the name of this main file (ie, 'cli-<command>')
program.command(
"dotnet",
"Run various dotnet test runner commands for the project"
);
// Attempt to parse the arguments passed in and defer to subcommands, if any.
// If no arguments are passed in, this will automatically display the help information for the user.
program.parse(process.argv);
// #endregion Entrypoint / Command router
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment