mirror of https://github.com/buggins/dlangui.git
fix #399
This commit is contained in:
parent
1125fa6239
commit
2ab32a5ecf
|
@ -792,6 +792,14 @@ deprecated string[] splitPath(string path) {
|
|||
return res;
|
||||
}
|
||||
|
||||
/// if pathName is not absolute path, convert it to absolute (assuming it is relative to current directory)
|
||||
string toAbsolutePath(string pathName) {
|
||||
import std.path : isAbsolute, absolutePath, buildNormalizedPath;
|
||||
if (pathName.isAbsolute)
|
||||
return pathName;
|
||||
return pathName.absolutePath.buildNormalizedPath;
|
||||
}
|
||||
|
||||
/// for executable name w/o path, find absolute path to executable
|
||||
string findExecutablePath(string executableName) {
|
||||
import std.string : split;
|
||||
|
|
|
@ -1887,6 +1887,10 @@ mixin template APP_ENTRY_POINT() {
|
|||
static if (BACKEND_CONSOLE) {
|
||||
int main(string[] args)
|
||||
{
|
||||
if (args.length > 1)
|
||||
args = args[1 .. $];
|
||||
else
|
||||
args = null;
|
||||
return DLANGUImain(args);
|
||||
}
|
||||
} else {
|
||||
|
@ -1909,6 +1913,10 @@ mixin template APP_ENTRY_POINT() {
|
|||
} else {
|
||||
int main(string[] args)
|
||||
{
|
||||
if (args.length > 1)
|
||||
args = args[1 .. $];
|
||||
else
|
||||
args = null;
|
||||
return DLANGUImain(args);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1623,6 +1623,10 @@ int sdlmain(string[] args) {
|
|||
|
||||
version (unittest) {
|
||||
} else {
|
||||
if (args.length > 1)
|
||||
args = args[1 .. $];
|
||||
else
|
||||
args = null;
|
||||
res = UIAppMain(args);
|
||||
}
|
||||
|
||||
|
|
|
@ -1853,6 +1853,10 @@ extern(C) int DLANGUImain(string[] args)
|
|||
|
||||
version (unittest) {
|
||||
} else {
|
||||
if (args.length > 1)
|
||||
args = args[1 .. $];
|
||||
else
|
||||
args = null;
|
||||
res = UIAppMain(args);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue