Skip to content

Commit

Permalink
set package name to tcg_eventlog_tool
Browse files Browse the repository at this point in the history
  • Loading branch information
iadgovuser26 committed Jun 18, 2020
1 parent 5c61688 commit 6f965c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tools/tcg_eventlog_tool/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ buildscript {

// Produce packages
ospackage {
packageName='tcgeventlogtool'
packageName='tcg_eventlog_tool'
os=LINUX
arch=NOARCH
version='1.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class Commander {
private static final String VERIFY_STRING = "Verify";
private static final String VERSION_STRING = "version";
private static final String VERSION_NUMBER = "1.0";
private static final String REGEX = "[0-9]+";

private boolean hasArguments = false;
private boolean bValidArgs = true;
Expand Down Expand Up @@ -58,7 +59,7 @@ public Commander(final String[] args) {
if (hasArguments) {
parseArguments(args);
} else {
String[] defualtArgs=new String[1];
String[] defualtArgs = new String[1];
defualtArgs[0] = "-e";
hasArguments = true;
parseArguments(defualtArgs);
Expand All @@ -79,7 +80,7 @@ public final void parseArguments(final String[] args) {
tempValue = args[i];

if (args.length == 0) { // Process default params if none were given
bEventIds = true;
bEventIds = true;
} else {
switch (tempValue) {
case FULL_COMMAND_PREFIX + CONTENT_STRING:
Expand All @@ -88,11 +89,10 @@ public final void parseArguments(final String[] args) {
if (i < args.length - 1) { // Check for a filter following the -e
if (!args[i + 1].startsWith("-")) {
eventFilter = args[i++ + 1];
if(eventFilter.chars().allMatch( Character::isDigit )) {
if (eventFilter.matches(REGEX)) {
eventNumber = Integer.parseInt(eventFilter);
} else {
System.out.println("invalid parameter following -e: " + eventFilter);
System.exit(1);
}
}
}
Expand Down Expand Up @@ -141,11 +141,10 @@ public final void parseArguments(final String[] args) {
if (i < args.length - 1) { // Check for a filter following the -p
if (!args[i + 1].startsWith("-")) {
pcrFilter = args[i++ + 1 ];
if(pcrFilter.chars().allMatch( Character::isDigit )) {
if (pcrFilter.matches(REGEX)) {
pcrNumber = Integer.parseInt(pcrFilter);
} else {
System.out.println("invalid parameter following -p: " + pcrFilter);
System.exit(1);
}
}
}
Expand Down

0 comments on commit 6f965c5

Please sign in to comment.