Index: ShellPkg/Application/Shell/Shell.c
===================================================================
--- ShellPkg/Application/Shell/Shell.c	(revision 16814)
+++ ShellPkg/Application/Shell/Shell.c	(working copy)
@@ -2,7 +2,7 @@
   This is THE shell (application)
 
   Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
-  (C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.<BR>
+  (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
   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
@@ -1987,11 +1987,12 @@
   IN OUT CHAR16 **CmdLine
   )
 {
-  CHAR16 *CurrentParameter;
-  CHAR16 *Walker;
-  CHAR16 *LastWalker;
-  CHAR16 *NewCommandLine;
+  CHAR16     *CurrentParameter;
+  CHAR16     *Walker;
+  CHAR16     *LastWalker;
+  CHAR16     *NewCommandLine;
   EFI_STATUS Status;
+  UINTN      Index; 
 
   Status = EFI_SUCCESS;
 
@@ -2005,8 +2006,19 @@
     LastWalker = Walker;
     if (!EFI_ERROR(GetNextParameter(&Walker, &CurrentParameter, StrSize(*CmdLine)))) {
       if (StrStr(CurrentParameter, L"-?") == CurrentParameter) {
-        LastWalker[0] = L' ';
-        LastWalker[1] = L' ';
+        if (StrnCmp (LastWalker, L"-?", StrLen (L"-?")) == 0) {
+          LastWalker[0] = L' ';
+          LastWalker[1] = L' ';
+        } else {
+          Index = 0;
+          while (StrnCmp (LastWalker + Index, L"-?", StrLen (L"-?")) != 0) {
+            LastWalker[Index] = L' ';
+            Index++;
+          }
+          LastWalker[Index]   = L' ';
+          LastWalker[Index+1] = L' ';
+        }
+
         NewCommandLine = AllocateZeroPool(StrSize(L"help ") + StrSize(*CmdLine));
         if (NewCommandLine == NULL) {
           Status = EFI_OUT_OF_RESOURCES;
