rename --target to --input
This commit is contained in:
parent
4cbbd2961e
commit
a10bbc005e
@ -521,9 +521,9 @@ def missing_arg(arg):
|
||||
def help():
|
||||
helpstring = """Synopsis:
|
||||
Inject <inject-file> into <target-file>:
|
||||
python3 html-inect.py --target <target-file> --output <output-file> [OPTIONS]
|
||||
python3 html-inect.py --input <input-file> --output <output-file> [OPTIONS]
|
||||
\nCommand line options:
|
||||
--target <file> path to the target file
|
||||
--input <file> path to the input file
|
||||
--output <file> output to this file instead of overwriting target
|
||||
--inplace edit target file in place
|
||||
--var <varname>=<value> set the value of a variable. Can be used multiple times
|
||||
@ -543,7 +543,7 @@ if __name__ == "__main__":
|
||||
inplace = False
|
||||
i = 1
|
||||
while i in range(1, len(argv)):
|
||||
if argv[i] == "--target":
|
||||
if argv[i] == "--input":
|
||||
if len(argv) > i + 1: target_path = argv[i+1].strip(" ")
|
||||
else: missing_arg_val(argv[i])
|
||||
i += 1
|
||||
@ -578,7 +578,7 @@ if __name__ == "__main__":
|
||||
error(f"Invalid argument: {argv[i]}")
|
||||
i += 1
|
||||
# sanity checks
|
||||
if not target_path: missing_arg("--target")
|
||||
if not target_path: missing_arg("--input")
|
||||
if not os.path.isfile(target_path): error(f"Invalid target: {target_path} (does not exist)")
|
||||
if inplace: output_path = target_path
|
||||
if not output_path:
|
||||
|
Loading…
Reference in New Issue
Block a user