@@ -54,17 +54,13 @@ if __name__ == '__main__': | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Load project file if set | # Load project file if set | ||||
args = app.arguments() | |||||
for arg in app.arguments(): | |||||
if arg.startswith("--with-appname=") or arg.startswith("--with-libprefix=") or arg == "--gdb": | |||||
continue | |||||
if len(args) > 1: | |||||
arg = args[-1] | |||||
if arg.startswith("--with-appname=") or arg.startswith("--with-libprefix="): | |||||
pass | |||||
elif arg == "--gdb": | |||||
pass | |||||
elif os.path.exists(arg): | |||||
if os.path.exists(arg): | |||||
gui.loadProjectLater(arg) | gui.loadProjectLater(arg) | ||||
break | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Show GUI | # Show GUI | ||||
@@ -56,17 +56,13 @@ if __name__ == '__main__': | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Load project file if set | # Load project file if set | ||||
args = app.arguments() | |||||
for arg in app.arguments(): | |||||
if arg.startswith("--with-appname=") or arg.startswith("--with-libprefix=") or arg == "--gdb": | |||||
continue | |||||
if len(args) > 1: | |||||
arg = args[-1] | |||||
if arg.startswith("--with-appname=") or arg.startswith("--with-libprefix="): | |||||
pass | |||||
elif arg == "--gdb": | |||||
pass | |||||
elif os.path.exists(arg): | |||||
if os.path.exists(arg): | |||||
gui.loadProjectLater(arg) | gui.loadProjectLater(arg) | ||||
break | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Show GUI | # Show GUI | ||||
@@ -56,17 +56,13 @@ if __name__ == '__main__': | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Load project file if set | # Load project file if set | ||||
args = app.arguments() | |||||
for arg in app.arguments(): | |||||
if arg.startswith("--with-appname=") or arg.startswith("--with-libprefix=") or arg == "--gdb": | |||||
continue | |||||
if len(args) > 1: | |||||
arg = args[-1] | |||||
if arg.startswith("--with-appname=") or arg.startswith("--with-libprefix="): | |||||
pass | |||||
elif arg == "--gdb": | |||||
pass | |||||
elif os.path.exists(arg): | |||||
if os.path.exists(arg): | |||||
gui.loadProjectLater(arg) | gui.loadProjectLater(arg) | ||||
break | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Show GUI | # Show GUI | ||||
@@ -541,7 +541,7 @@ def getIcon(icon, size = 16): | |||||
# Handle some basic command-line arguments shared between all carla variants | # Handle some basic command-line arguments shared between all carla variants | ||||
def handleInitialCommandLineArguments(file): | def handleInitialCommandLineArguments(file): | ||||
initName = os.path.basename(file) if ("__file__" in dir() and os.path.dirname(file) in PATH) else sys.argv[0] | |||||
initName = os.path.basename(file) if ("__file__" in dir() and os.path.dirname(file) in PATH) else sys.argv[0] | |||||
libPrefix = None | libPrefix = None | ||||
for arg in sys.argv: | for arg in sys.argv: | ||||
@@ -551,6 +551,36 @@ def handleInitialCommandLineArguments(file): | |||||
elif arg.startswith("--with-libprefix="): | elif arg.startswith("--with-libprefix="): | ||||
libPrefix = arg.replace("--with-libprefix=", "") | libPrefix = arg.replace("--with-libprefix=", "") | ||||
elif arg == "--gdb": | |||||
pass | |||||
elif arg in ("-h", "--h", "-help", "--help"): | |||||
print("Usage: %s [OPTION]... [FILE|URL]" % initName) | |||||
print("") | |||||
print(" where FILE can be a Carla project or preset file to be loaded, or URL if using Carla-Control") | |||||
print("") | |||||
print(" and OPTION can be one or more of the following:") | |||||
print("") | |||||
print(" --gdb \t Run Carla inside gdb.") | |||||
print("") | |||||
print(" -h,--help \t Print this help text and exit.") | |||||
print(" -v,--version\t Print version information and exit.") | |||||
print("") | |||||
sys.exit(0) | |||||
elif arg in ("-v", "--v", "-version", "--version"): | |||||
pathBinaries, pathResources = getPaths(libPrefix) | |||||
print("Using Carla version %s" % VERSION) | |||||
print(" Python version: %s" % sys.version.split(" ",1)[0]) | |||||
print(" Qt version: %s" % qVersion()) | |||||
print(" PyQt version: %s" % PYQT_VERSION_STR) | |||||
print(" Binary dir: %s" % pathBinaries) | |||||
print(" Resources dir: %s" % pathResources) | |||||
sys.exit(0) | |||||
return (initName, libPrefix) | return (initName, libPrefix) | ||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||