import argparse
import sys
def archive_options():
"""Archives command-line options."""
parser = argparse.ArgumentParser(description="Archive command-line options.")
# Define your options here. Example:
parser.add_argument("--input_file", type=str, help="Path to the input file.")
parser.add_argument("--output_dir", type=str, help="Path to the output directory.")
parser.add_argument("--log_level", type=str, default="INFO", help="Logging level.")
args = parser.parse_args()
# Archive the options (e.g., print them to the console or save to a file)
print("Archived Options:")
print(f" Input File: {args.input_file}")
print(f" Output Directory: {args.output_dir}")
print(f" Log Level: {args.log_level}")
# You can save the options to a file if needed:
# with open("options.txt", "w") as f:
# f.write(f"Input File: {args.input_file}\n")
# f.write(f"Output Directory: {args.output_dir}\n")
# f.write(f"Log Level: {args.log_level}\n")
if __name__ == "__main__":
archive_options()
Add your comment