Do not force argsparse code to all modules importing cavstool.py. The commit moves argparse code into a separate function, and calls it from 'if __name__ == "__main__":'. Also adds the argsparse call to to acetool.py that shares cavstool code with the argument parsing. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
14 lines
312 B
Python
Executable File
14 lines
312 B
Python
Executable File
#!/usr/bin/env python3
|
|
# Copyright(c) 2022 Intel Corporation. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
import asyncio
|
|
import cavstool
|
|
|
|
if __name__ == "__main__":
|
|
cavstool.args_parse()
|
|
try:
|
|
asyncio.run(cavstool.main())
|
|
except KeyboardInterrupt:
|
|
start_output = False
|