Skip to content

Commit

Permalink
Fixed CLI welcome screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
pomek committed Jun 17, 2019
1 parent a6e508b commit 3da4cae
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const chalk = require( 'chalk' );
const meow = require( 'meow' );
const mgit = require( './lib/index' );
const mrgit = require( './lib/index' );
const getCommandInstance = require( './lib/utils/getcommandinstance' );

handleCli();
Expand Down Expand Up @@ -54,18 +54,18 @@ function handleCli() {

const cli = meow( `${ logo }
${ u( 'Usage:' ) }
$ mgit ${ c( 'command' ) } ${ y( '[--options]' ) } -- ${ m( '[--git-options]' ) }
$ mrgit ${ c( 'command' ) } ${ y( '[--options]' ) } -- ${ m( '[--git-options]' ) }
${ u( 'Commands:' ) }
${ c( 'checkout' ) } Changes branches in repositories according to the configuration file.
${ c( 'close' ) } Merges specified branch with the current one and remove merged branch from the remote.
${ c( 'commit' ) } Commits all changes. A shorthand for "mgit exec 'git commit -a'".
${ c( 'commit' ) } Commits all changes. A shorthand for "mrgit exec 'git commit -a'".
${ c( 'diff' ) } Prints changes from packages where something has changed.
${ c( 'exec' ) } Executes shell command in each package.
${ c( 'fetch' ) } Fetches existing repositories.
${ c( 'pull' ) } Pulls changes in existing repositories.
${ c( 'push' ) } Pushes changes in existing repositories to remotes.
${ c( 'save' ) } Saves hashes of packages in mgit.json. It allows to easily fix project to a specific state.
${ c( 'save' ) } Saves hashes of packages in mrgit.json. It allows to easily fix project to a specific state.
${ c( 'status' ) } Prints a table which contains useful information about the status of repositories.
${ c( 'sync' ) } Updates packages to the latest versions or install missing ones.
Expand All @@ -77,7 +77,7 @@ function handleCli() {
${ y( '--hash' ) } Whether to save current commit hashes. Used only by "${ u( 'save' ) }" command.
${ y( '--ignore' ) } Ignores packages which names match the given glob pattern. E.g.:
${ g( '> mgit exec --ignore="foo*" "git status"' ) }
${ g( '> mrgit exec --ignore="foo*" "git status"' ) }
Will ignore all packages which names start from "foo".
${ g( 'Default: null' ) }
Expand Down Expand Up @@ -108,26 +108,26 @@ function handleCli() {
whether the repository will be cloned to packages/@scope/pkgname' or 'packages/pkgname'.
${ g( 'Default: \'git\'' ) }
${ y( '--resolver-default-branch' ) } The branch name to use if not specified in mgit.json dependencies.
${ y( '--resolver-default-branch' ) } The branch name to use if not specified in mrgit.json dependencies.
${ g( 'Default: master' ) }
${ y( '--scope' ) } Restricts the command to packages which names match the given glob pattern.
${ g( 'Default: null' ) }
${ u( 'Git Options:' ) }
Git options are supported by the following commands: commit, diff, fetch, push.
Type "mgit [command] -h" in order to see which options are supported.
Type "mrgit [command] -h" in order to see which options are supported.
`, meowOptions );

const commandName = cli.input[ 0 ];

// If user specified a command and `--help` flag wasn't active.
if ( commandName && !cli.flags.help ) {
return mgit( cli.input, cli.flags );
return mrgit( cli.input, cli.flags );
}

// A user wants to see "help" screen.
// Missing command. Displays help screen for the entire Mgit.
// Missing command. Displays help screen for the entire Mr. Git.
if ( !commandName ) {
return cli.showHelp( 0 );
}
Expand Down

0 comments on commit 3da4cae

Please sign in to comment.