Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
7d7aad4b
Commit
7d7aad4b
authored
May 31, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
__main__: add a top-level function to support a testsuite.
parent
81895179
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
__main__.py
hdlmake/__main__.py
+12
-9
No files found.
hdlmake/__main__.py
View file @
7d7aad4b
...
...
@@ -32,7 +32,7 @@ from .module_pool import ModulePool
from
._version
import
__version__
def
main
(
):
def
hdlmake
(
args
):
"""This is the main function, where HDLMake starts.
Here, we make the next processes:
-- parse command
...
...
@@ -48,7 +48,7 @@ def main():
#
# PARSE & GET OPTIONS
#
options
=
_get_options
(
sy
s
,
parser
)
options
=
_get_options
(
arg
s
,
parser
)
# Create a ModulePool object, this will become our workspace
modules_pool
=
ModulePool
(
options
)
...
...
@@ -62,7 +62,6 @@ def _action_runner(modules_pool):
options
=
modules_pool
.
options
if
options
.
command
==
"manifest-help"
:
ManifestParser
()
.
print_help
()
quit
(
0
)
elif
options
.
command
==
"makefile"
:
modules_pool
.
makefile
()
elif
options
.
command
==
"fetch"
:
...
...
@@ -190,18 +189,22 @@ def _get_parser():
return
parser
def
_get_options
(
sys_aux
,
parser
):
def
_get_options
(
args
,
parser
):
"""Function that decodes and set the provided command user options"""
options
=
None
if
len
(
sys_aux
.
argv
[
1
:]
)
==
0
:
if
len
(
args
)
==
0
:
options
=
parser
.
parse_args
([
'makefile'
])
elif
len
(
sys_aux
.
argv
[
1
:]
)
==
2
and
(
sys_aux
.
argv
[
1
]
==
'-f'
or
sys_aux
.
argv
[
1
]
==
'--filename'
):
options
=
parser
.
parse_args
([
'makefile'
]
+
sys_aux
.
argv
[
1
:]
)
elif
len
(
args
)
==
2
and
(
args
[
0
]
==
'-f'
or
args
[
0
]
==
'--filename'
):
options
=
parser
.
parse_args
([
'makefile'
]
+
args
)
else
:
options
=
parser
.
parse_args
(
sys_aux
.
argv
[
1
:]
)
options
=
parser
.
parse_args
(
args
)
return
options
def
main
():
"""Entry point used by the executable"""
hdlmake
(
sys
.
argv
[
1
:])
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment