Initial boilerplate.

This commit is contained in:
Achim D. Brucker 2016-09-21 09:12:54 +01:00
parent 82d4e504fa
commit 01d9b95d81
1 changed files with 34 additions and 0 deletions

View File

@ -15,3 +15,37 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import argparse
# https://developer.chrome.com/extensions/crx
def verify_crxfile (verbose, filename):
print("Not yet implemented: verify crxfile(", verbose,", ", filename, ")")
def extract_crxfile(verbose, force, filename):
print("Not yet implemented: extract crxfile(",verbose,", ", force,", ", filename, ")")
def main():
parser = argparse.ArgumentParser()
parser.add_argument("file", help="chrome extension archive (*.crx)")
parser.add_argument("-c", "--check", help="verify format and signature of <file>",
action="store_true")
parser.add_argument("-e", "--extract", help="extract <file>",
action="store_true")
parser.add_argument("-f", "--force", help="apply action also to (potential) invalid files",
action="store_true")
parser.add_argument("-v", "--verbose", help="increase verbosity",
action="store_true")
args = parser.parse_args()
if args.extract:
retval = extract_crxfile(args.verbose, args.force, args.file)
else:
retval = verify_crxfile(args.verbose, args.file)
exit(retval)
if __name__ == "__main__":
main()