Skip to content

Commit

Permalink
Merge pull request #6 from mnapoli/help
Browse files Browse the repository at this point in the history
Add help
  • Loading branch information
mnapoli authored Nov 18, 2017
2 parents e3d6163 + 2e9be6c commit c4e4e8b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pretty
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ $commands = [
];

$task = isset($argv[1]) ? $argv[1] : 'default';

if ($task === 'help') {
help();
exit(0);
}
if (!isset($commands[$task])) {
echo "Unrecognized command '$task'\n";
help();
exit(1);
}

$commands = $commands[$task];

$command = '';
Expand Down Expand Up @@ -89,3 +100,14 @@ INSTRUCTIONS;
exit(1);
}
}

function help()
{
echo <<<'HELP'
Available commands:
- pretty: runs an analysis (will not fix the code)
- pretty fix: fix as many errors as possible in the code
- pretty ci: runs an analysis in a continuous integration environment
- pretty help: displays this help
HELP;
}

0 comments on commit c4e4e8b

Please sign in to comment.