Skip to content

Commit c4e4e8b

Browse files
authored
Merge pull request #6 from mnapoli/help
Add help
2 parents e3d6163 + 2e9be6c commit c4e4e8b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pretty

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ $commands = [
3232
];
3333

3434
$task = isset($argv[1]) ? $argv[1] : 'default';
35+
36+
if ($task === 'help') {
37+
help();
38+
exit(0);
39+
}
40+
if (!isset($commands[$task])) {
41+
echo "Unrecognized command '$task'\n";
42+
help();
43+
exit(1);
44+
}
45+
3546
$commands = $commands[$task];
3647

3748
$command = '';
@@ -89,3 +100,14 @@ INSTRUCTIONS;
89100
exit(1);
90101
}
91102
}
103+
104+
function help()
105+
{
106+
echo <<<'HELP'
107+
Available commands:
108+
- pretty: runs an analysis (will not fix the code)
109+
- pretty fix: fix as many errors as possible in the code
110+
- pretty ci: runs an analysis in a continuous integration environment
111+
- pretty help: displays this help
112+
HELP;
113+
}

0 commit comments

Comments
 (0)