X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FContextTool%2Forg%2Ftianocore%2Fcontext%2FHelpInfo.java;h=b65ee0a131898de3720a16679a95b489d7a676a0;hp=09daf023b67df0aa9dafbc106bc394f82c56a1c8;hb=2c71f6e5abba8841dce06d4686e6b4733c655285;hpb=c74c7a43020713e9d9e11098e3118472d920c2ff diff --git a/Tools/Source/ContextTool/org/tianocore/context/HelpInfo.java b/Tools/Source/ContextTool/org/tianocore/context/HelpInfo.java index 09daf023b6..b65ee0a131 100644 --- a/Tools/Source/ContextTool/org/tianocore/context/HelpInfo.java +++ b/Tools/Source/ContextTool/org/tianocore/context/HelpInfo.java @@ -1,5 +1,20 @@ +/** @file + File is HelpInfo class which is used to output the usage info. + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + package org.tianocore.context; +import java.util.LinkedList; + public class HelpInfo { @@ -9,12 +24,15 @@ public class HelpInfo { * @return no return value **/ public static void outputUsageInfo() { + System.out.printf("\n%s", DescripationString); System.out.printf("\n%s", UsageInfoString); System.out.printf("\n%s", DetailOfOptionString); - for (int i = 0; i < 6; i++) { + for (int i = 0; i < settingnum; i++) { outputSubUsageInfo(UsageString[i], UsageStringInfo[i]); } + + System.out.printf("\n%s", ExampleString); } /** @@ -24,17 +42,13 @@ public class HelpInfo { * @return no return value **/ private static void outputSubUsageInfo(String str1, String str2) { + splitString(str2); - if (substrnum > 0) { - System.out.printf("\n%4s %-30s %s", "", str1, substr[0]); - for (int i = 1; i < substrnum; i++) { - if (substr[i] != null) - System.out.printf("\n%4s %-30s %s", "", "", substr[i]); - } - substrnum = 0; - } else { - System.out.printf("\n%4s %-30s %s", "", str1, str2); + System.out.printf("\n%4s %-30s %s", "", str1, List.get(0)); + for (int i=1; i MaxSrtingLength) { - - //we should modify the array to list, for it is strange to + 2 - substrnum = strlength / MaxSrtingLength + 2; String[] tokens = str.split("[ ]", 0); - substr = new String[substrnum]; + String tempstr = null; int templength = 0; - int j = 0; int start = 0; int end = 0; for (int i = 0; i < tokens.length; i++) { if ((templength = end + tokens[i].length() + 1) < (MaxSrtingLength + start)) { end = templength; } else { - substr[j++] = str.substring(start, end); + tempstr = str.substring(start, end); + List.add(tempstr); start = end; i = i - 1; } } - substr[j] = str.substring(start, end - 1); + tempstr = str.substring(start, end - 1); + List.add(tempstr); + } else { + List.add(str); } } - private static String[] substr = null; - - private static int substrnum = 0; + + private static LinkedList List = new LinkedList(); private static final int MaxSrtingLength = 40; - - private static final String UsageInfoString = "Usage: context [-option1] [args] [-option2] [args] ..."; + + private static final int settingnum = 7; + + private static final String DescripationString = "The purpose of this tool is modifying the settings in target.txt"; + + private static final String UsageInfoString = "Usage: ContextTool [-option1] [args] [-option2] [args] ..."; private static final String DetailOfOptionString = "Where options include:"; + + private static final String ExampleString = "Example: ContextTool -a IA32 IA64 EBC -c Tools/Conf/tools_def.txt -t DEBUG -n GCC -p EdkNt32Pkg/Nt32.fpd -m 2\n"; private static final String HString = "-h"; - private static final String HStringInfo = "print this help message"; + private static final String HStringInfo = "print usage info"; private static final String AString = "-a "; @@ -87,7 +106,7 @@ public class HelpInfo { private static final String CString = "-c "; - private static final String CStringInfo = "Assign a txt file, which specify the tools to use for the build and must be located in the path: WORKSPACE/Tools/Conf/. If no file is specified, the default filename is \"tools_def.txt\""; + private static final String CStringInfo = "Assign a txt file with the relative path to WORKSPACE, which specify the tools to use for the build and must be located in the path: WORKSPACE/Tools/Conf/. If no file is specified, the default filename is \"tools_def.txt\""; private static final String NString = "-n "; @@ -101,9 +120,13 @@ public class HelpInfo { private static final String TStringInfo = "What kind of the version is the binary target, such as DEBUG, RELEASE. Multiple values can be specified on a single line, using space to separate the values."; + private static final String MString = "-m "; + + private static final String MStringInfo = "number should GE 0. 0 clears both MULTIPLE_THREAD and MAX_CONCURRENT_THREAD_NUMBER, others enable MULTIPLE_THREAD and set MAX_CONCURRENT_THREAD_NUMBER."; + private static final String[] UsageString = { HString, AString, CString, - NString, PString, TString }; + NString, PString, TString, MString }; private static final String[] UsageStringInfo = { HStringInfo, AStringInfo, - CStringInfo, NStringInfo, PStringInfo, TStringInfo }; + CStringInfo, NStringInfo, PStringInfo, TStringInfo, MStringInfo }; }