scripts: gen_cfb_font_header: correct command sanitization
The code to sanitize the generated font path by removing bindir improperly stripped the first character of every argument when --bindir was not provided, corrupting the command documentation when fonts are generated manually. Only sanitize if --bindir was provided with non-empty content. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
parent
8b4d529706
commit
98a8e293cb
1 changed files with 2 additions and 2 deletions
|
@ -75,7 +75,7 @@ def generate_header():
|
|||
if arg.startswith("--bindir"):
|
||||
# Drop. Assumes --bindir= was passed with '=' sign.
|
||||
continue
|
||||
if arg.startswith(args.bindir):
|
||||
if args.bindir and arg.startswith(args.bindir):
|
||||
# +1 to also strip '/' or '\' separator
|
||||
striplen = min(len(args.bindir)+1, len(arg))
|
||||
clean_cmd.append(arg[striplen:])
|
||||
|
@ -158,7 +158,7 @@ def parse_args():
|
|||
"-o", "--output", type=argparse.FileType('w'), default="-", metavar="FILE",
|
||||
help="CFB font header file (default: stdout)")
|
||||
group.add_argument(
|
||||
"--bindir", type=str, default="",
|
||||
"--bindir", type=str,
|
||||
help="CMAKE_BINARY_DIR for pure logging purposes. No trailing slash.")
|
||||
group.add_argument(
|
||||
"-x", "--width", required=True, type=int,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue