提交 9099a298 编写于 作者: S Serge Rider

Command line parsing fix


Former-commit-id: bcea92b8
上级 f649485c
......@@ -24,10 +24,7 @@ import org.apache.commons.cli.Option;
import org.eclipse.core.runtime.Platform;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.osgi.internal.framework.EquinoxBundle;
import org.eclipse.osgi.internal.framework.EquinoxConfiguration;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.service.environment.EnvironmentInfo;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.MessageBox;
......@@ -35,13 +32,10 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.PlatformUI;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.IInstanceController;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.core.DBeaverCore;
import org.jkiss.utils.ArrayUtils;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceReference;
import java.io.File;
import java.net.URL;
......@@ -229,16 +223,7 @@ public class DBeaverApplication implements IApplication
public static CommandLine getCommandLine() {
try {
String[] args = Platform.getApplicationArgs();
Bundle bundle = Activator.getInstance().getBundle();
ServiceReference<EnvironmentInfo> configRef = bundle.getBundleContext().getServiceReference(EnvironmentInfo.class);
if (configRef != null) {
EnvironmentInfo environmentInfo = bundle.getBundleContext().getService(configRef);
if (environmentInfo != null) {
args = environmentInfo.getNonFrameworkArgs();
}
}
return new DefaultParser().parse(DBeaverCommandLine.ALL_OPTIONS, args, false);
return new DefaultParser().parse(DBeaverCommandLine.ALL_OPTIONS, Platform.getApplicationArgs(), false);
} catch (Exception e) {
log.error("Error parsing command line", e);
return null;
......
......@@ -66,7 +66,8 @@ public class EditorUtils {
final IPath path = ((IPathEditorInput) editorInput).getPath();
return ContentUtils.convertPathToWorkspaceFile(path);
} else if (editorInput instanceof IURIEditorInput) {
//((IURIEditorInput) editorInput).getURI()
// Most likely it is an external file
return null;
}
// Try to get path input adapter (works for external files)
final IPathEditorInput pathInput = editorInput.getAdapter(IPathEditorInput.class);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册