Rectangles in incons
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
from PySide6.QtWidgets import QApplication
|
||||
|
||||
@@ -15,8 +16,22 @@ from bedit_gui.documents import Document
|
||||
from bedit_gui.services.application_settings import ApplicationSettings
|
||||
from bedit_gui.views.main_window import MainWindow
|
||||
|
||||
def parse_arguments():
|
||||
parser = argparse.ArgumentParser(exit_on_error=False)
|
||||
|
||||
parser.add_argument(
|
||||
"-f", "--file", type=str, help="Path to a file to open", default=None, required=False
|
||||
)
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
def main() -> int:
|
||||
try:
|
||||
args = parse_arguments()
|
||||
except argparse.ArgumentError as e:
|
||||
print(e.message)
|
||||
return 1
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
app.setOrganizationName("BEdit")
|
||||
@@ -36,7 +51,11 @@ def main() -> int:
|
||||
window_state_controller = WindowStateController(app, window)
|
||||
window_state_controller.restore()
|
||||
|
||||
document.new()
|
||||
if args.file:
|
||||
document.open(args.file)
|
||||
else:
|
||||
document.new()
|
||||
|
||||
window.showMaximized()
|
||||
|
||||
return app.exec()
|
||||
|
||||
Reference in New Issue
Block a user