TMP / Minor fixes for embed.py and pre-commit.py

- embed.py: fixed --help output
- pre-commit.py: removed whitespace in blank lines
This commit is contained in:
OLEGSHA 2023-04-05 00:24:11 +02:00
parent a227556ae3
commit 2f57a06ebd
2 changed files with 45 additions and 44 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
usage = \ usage = \
'''Usage: embed.py --cpp OUT_CPP --header OUT_H [--] [INPUT as PATH]... '''Usage: %(me)s --cpp OUT_CPP --header OUT_H [--] [INPUT as PATH]...
Generate C++ source code that includes binary contents of INPUT files. Generate C++ source code that includes binary contents of INPUT files.
Each file in INPUT is stored as a resource: a static array of unsigned char. Each file in INPUT is stored as a resource: a static array of unsigned char.
@ -79,6 +79,7 @@ def main():
fail(f"Unknown option '{arg}'") fail(f"Unknown option '{arg}'")
elif considerOptions and (arg == '-h' or arg == '--help'): elif considerOptions and (arg == '-h' or arg == '--help'):
print(usage % {'me': os.path.basename(sys.argv[0])})
sys.exit(0) sys.exit(0)
elif considerOptions and arg == '--': elif considerOptions and arg == '--':