only print out files that contain the string *.efi\r
dir fv1:\ ; perform a dir on fv1: device in the efi directory \r
NOTE: fv devices do not contian subdirs \r
- dir fv1:\ * PEIM ; will match all files of type SEC\r
+ dir fv1:\ * PEIM ; will match all files of type PEIM\r
\r
@param Argc Number of command arguments in Argv\r
@param Argv Array of strings that represent the parsed command line. \r
UINTN Length;\r
UINTN BestMatchCount;\r
CHAR16 UnicodeFileName[MAX_CMD_LINE];\r
+ CHAR8 *Path;\r
\r
\r
if (Argc <= 1) {\r
- // CWD not currently supported \r
- return EFI_SUCCESS;\r
+ Path = EfiGetCwd ();\r
+ if (Path == NULL) {\r
+ return EFI_SUCCESS;\r
+ }\r
+ } else {\r
+ Path = Argv[1];\r
}\r
\r
- File = EfiOpen (Argv[1], EFI_FILE_MODE_READ, 0);\r
+ File = EfiOpen (Path, EFI_FILE_MODE_READ, 0);\r
if (File == NULL) {\r
return EFI_SUCCESS;\r
}\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Change the Current Working Directory\r
+\r
+ Argv[0] - "cd"\r
+ Argv[1] - Device Name:path. Path is optional \r
+\r
+ @param Argc Number of command arguments in Argv\r
+ @param Argv Array of strings that represent the parsed command line. \r
+ Argv[0] is the comamnd name\r
+\r
+ @return EFI_SUCCESS\r
+\r
+**/\r
+EFI_STATUS\r
+EblCdCmd (\r
+ IN UINTN Argc,\r
+ IN CHAR8 **Argv\r
+ )\r
+{\r
+ if (Argc <= 1) {\r
+ return EFI_SUCCESS;\r
+ } \r
+ \r
+ return EfiSetCwd (Argv[1]);\r
+}\r
+\r
\r
\r
GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mCmdDirTemplate[] =\r
" dirdev [*match]; directory listing of dirdev. opt match a substring",\r
NULL,\r
EblDirCmd\r
+ },\r
+ {\r
+ "cd",\r
+ " device - set the current working directory",\r
+ NULL,\r
+ EblCdCmd\r
}\r
};\r
\r