summaryrefslogtreecommitdiffstats
path: root/edksetup.sh
diff options
context:
space:
mode:
authorParmeshwr Prasad <parmeshwr_prasad@dell.com>2014-01-28 02:18:23 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2014-01-28 02:18:23 +0000
commit729220eacac90990e9145fd129036ffc1488e1eb (patch)
treece99db45eb76791094709ccde71da2b950590dfb /edksetup.sh
parent71c49eafc54f2f3158ed8861a90cb6eb95e13f97 (diff)
downloadedk2-729220eacac90990e9145fd129036ffc1488e1eb.tar.gz
edk2-729220eacac90990e9145fd129036ffc1488e1eb.tar.bz2
edk2-729220eacac90990e9145fd129036ffc1488e1eb.zip
Handle command line parameter "-? -h --help" and any other.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Parmeshwr Prasad <parmeshwr_prasad@dell.com> Reviewed-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15192 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'edksetup.sh')
-rwxr-xr-xedksetup.sh43
1 files changed, 32 insertions, 11 deletions
diff --git a/edksetup.sh b/edksetup.sh
index 8eeea11303..39b76e1c22 100755
--- a/edksetup.sh
+++ b/edksetup.sh
@@ -25,24 +25,45 @@
# Please reference edk2 user manual for more detail descriptions at https://edk2.tianocore.org/files/documents/64/494/EDKII_UserManual.pdf
#
+function HelpMsg()
+{
+ echo Please note: This script must be \'sourced\' so the environment can be changed.
+ echo ". edksetup.sh"
+ echo "source edksetup.sh"
+}
+
+function SetupEnv()
+{
+ if [ -z "$WORKSPACE" ]
+ then
+ . BaseTools/BuildEnv $*
+ else
+ . $WORKSPACE/BaseTools/BuildEnv $*
+ fi
+}
+
+function SourceEnv()
+{
if [ \
"$1" = "-?" -o \
"$1" = "-h" -o \
"$1" = "--help" \
]
then
- echo BaseTools Usage: \'. edksetup.sh\'
- echo
- echo Please note: This script must be \'sourced\' so the environment can be changed.
- echo \(Either \'. edksetup.sh\' or \'source edksetup.sh\'\)
+ HelpMsg
return
-fi
-
-if [ -z "$WORKSPACE" ]
-then
- . BaseTools/BuildEnv $*
else
- . $WORKSPACE/BaseTools/BuildEnv $*
+ SetupEnv "$*"
fi
-
+}
+if [ $# -gt 1 ]
+then
+ HelpMsg
+ return
+elif [ $# -eq 1 ] && [ "$1" != "BaseTool" ]
+then
+ HelpMsg
+ return
+fi
+SourceEnv "$*"