mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-25 08:17:11 -07:00
Merge pull request #32 from sombriks/main
setting exit status for unknown command
This commit is contained in:
commit
60c332d750
2 changed files with 5 additions and 2 deletions
|
@ -463,6 +463,7 @@ public class BuildExecutor {
|
|||
new HelpOperation(this, arguments()).executePrintOverviewHelp();
|
||||
System.err.println();
|
||||
System.err.println("ERROR: unknown command '" + command + "'");
|
||||
exitStatus(1);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -292,14 +292,16 @@ public class TestProject {
|
|||
try {
|
||||
var result = new StringBuilder();
|
||||
var project = new CustomProjectLambda(tmp, result);
|
||||
project.execute(new String[]{"ne2", "nc2", "n2"});
|
||||
var status = project.execute(new String[]{"ne2", "nc2", "n2"});
|
||||
assertEquals("newcommand2" +
|
||||
"newcommand2" +
|
||||
"newcommand2", result.toString());
|
||||
assertEquals(0, status, "Exit status should be 0");
|
||||
|
||||
result = new StringBuilder();
|
||||
project.execute(new String[]{"c"});
|
||||
status = project.execute(new String[]{"c"});
|
||||
assertEquals("", result.toString());
|
||||
assertEquals(1, status, "Exit status should be 1");
|
||||
} finally {
|
||||
FileUtils.deleteDirectory(tmp);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue