Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/__init__.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-02-07 17:57:16 +0100
committerAnton Hvornum <anton@hvornum.se>2021-02-07 17:57:16 +0100
commitc983976394cda6e0db5f3ae7079e172804d91885 (patch)
tree0c9a65d2365a55e1fc184c03135484941f3fc7b6 /archinstall/__init__.py
parent530edb5ece1350cbba568529cbba1f6c2eb36938 (diff)
Added in argument support to archinstall for easier testing and debugging
Diffstat (limited to 'archinstall/__init__.py')
-rw-r--r--archinstall/__init__.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/archinstall/__init__.py b/archinstall/__init__.py
index ee2d0361..d4452d38 100644
--- a/archinstall/__init__.py
+++ b/archinstall/__init__.py
@@ -12,4 +12,19 @@ from .lib.services import *
from .lib.packages import *
from .lib.output import *
from .lib.storage import *
-from .lib.hardware import * \ No newline at end of file
+from .lib.hardware import *
+
+## Basic version of arg.parse() supporting:
+## --key=value
+## --boolean
+arguments = {}
+positionals = []
+for arg in sys.argv[1:]:
+ if '--' == arg[:2]:
+ if '=' in arg:
+ key, val = [x.strip() for x in arg[2:].split('=', 1)]
+ else:
+ key, val = arg[2:], True
+ arguments[key] = val
+ else:
+ positionals.append(arg) \ No newline at end of file