INNER CODE UNIT · Python

init

tpm2-software/tpm2-pkcs11 · tools/tpm2_pkcs11/command.py:81

    def init(description):

        opt_parser = argparse.ArgumentParser(description=description)

        subparser = opt_parser.add_subparsers(help='commands')

        commandlets = commandlet.get()

        # for each commandlet, instantiate and set up their options
        for n, c in commandlets.items():
            p = subparser.add_parser(n, help=c.__doc__)
            p.set_defaults(which=n)
            # Instantiate

            opt_gen = getattr(c, 'generate_options', None)
            if callable(opt_gen):
                # get group help
                g = p.add_argument_group(n + ' options')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…