Skip to content
Snippets Groups Projects
Commit 6c29e0ea authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Improve a bit the main.py file

parent 7992cd0d
No related branches found
No related tags found
No related merge requests found
import sys
import mimetypes
from shutil import copyfile
import argparse
......@@ -18,10 +19,11 @@ def create_arg_parser():
help='list all the harmful metadata of a file without removing them')
return parser
def show_meta(file_name:str):
p = parser_factory.get_parser(file_name)
def show_meta(filename:str):
p = parser_factory.get_parser(filename)
if p is None:
print("[-] %s's format (%s) is not supported" % (file_name, p))
mtype, _ = mimetypes.guess_type(filename)
print("[-] %s's format (%s) is not supported" % (filename, mtype))
return
for k,v in p.get_meta().items():
print("%s: %s" % (k, v))
......@@ -36,7 +38,10 @@ def main():
return 0
for f in args.files:
p = parser_factory.get_parser(sys.argv[1])
p = parser_factory.get_parser(f)
if p is None:
print("[-] %s's format (%s) is not supported" % (f, "meh"))
continue
p.remove_all()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment