Add -lastproject editor command-line option to open the last project
This commit is contained in:
@@ -537,6 +537,13 @@ int32 Editor::LoadProduct()
|
|||||||
if (FileSystem::FileExists(lastProjectSettingPath))
|
if (FileSystem::FileExists(lastProjectSettingPath))
|
||||||
File::ReadAllText(lastProjectSettingPath, lastProjectPath);
|
File::ReadAllText(lastProjectSettingPath, lastProjectPath);
|
||||||
|
|
||||||
|
// Try to open the last project when requested
|
||||||
|
if (projectPath.IsEmpty() && CommandLine::Options.LastProject.IsTrue())
|
||||||
|
{
|
||||||
|
if (!lastProjectPath.IsEmpty() && FileSystem::DirectoryExists(lastProjectPath))
|
||||||
|
projectPath = lastProjectPath;
|
||||||
|
}
|
||||||
|
|
||||||
// Missing project case
|
// Missing project case
|
||||||
if (projectPath.IsEmpty())
|
if (projectPath.IsEmpty())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ bool CommandLine::Parse(const Char* cmdLine)
|
|||||||
PARSE_BOOL_SWITCH("-clearcache ", ClearCache);
|
PARSE_BOOL_SWITCH("-clearcache ", ClearCache);
|
||||||
PARSE_BOOL_SWITCH("-clearcooker ", ClearCookerCache);
|
PARSE_BOOL_SWITCH("-clearcooker ", ClearCookerCache);
|
||||||
PARSE_ARG_SWITCH("-project ", Project);
|
PARSE_ARG_SWITCH("-project ", Project);
|
||||||
|
PARSE_BOOL_SWITCH("-lastproject ", LastProject);
|
||||||
PARSE_BOOL_SWITCH("-new ", NewProject);
|
PARSE_BOOL_SWITCH("-new ", NewProject);
|
||||||
PARSE_BOOL_SWITCH("-genprojectfiles ", GenProjectFiles);
|
PARSE_BOOL_SWITCH("-genprojectfiles ", GenProjectFiles);
|
||||||
PARSE_ARG_SWITCH("-build ", Build);
|
PARSE_ARG_SWITCH("-build ", Build);
|
||||||
|
|||||||
@@ -147,6 +147,11 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
String Project;
|
String Project;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// -lastproject (Opens the last project)
|
||||||
|
/// </summary>
|
||||||
|
Nullable<bool> LastProject;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// -new (generates the project files inside the specified project folder or uses current workspace folder)
|
/// -new (generates the project files inside the specified project folder or uses current workspace folder)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user