GithubHelp home page GithubHelp logo

Comments (3)

polhenarejos avatar polhenarejos commented on August 17, 2024

parser.add_argument('--pin', help='PIN number') is correct. --pin argument is available not only for initialization, but also for other commands. It is a common parameter for all.

Fixed rtc_get.

from pico-hsm.

fchaxel avatar fchaxel commented on August 17, 2024

So in https://github.com/polhenarejos/pico-hsm/blob/master/doc/usage.md

$ python3 pico-hsm-tool.py initialize --so-pin 3537363231383830 --pin 648219

should be

$ python3 pico-hsm-tool.py --pin 648219 initialize --so-pin 3537363231383830

at the end of the command line --pin generates an error

HSM module work like a charm with XCA tool on Windows.

Bye

from pico-hsm.

fchaxel avatar fchaxel commented on August 17, 2024

Hi,

Back again with def parse_args(): in the script

In order to get the --pin args to be place after the command, and to use it with several sub command one can write something like this :

subparser = parser.add_subparsers(title="commands", dest="command")
parent = argparse.ArgumentParser(add_help=False)
parent.add_argument('--pin', help='PIN number')
parser_init = subparser.add_parser('initialize', help='Performs the first initialization of the Pico HSM.',parents=[parent])
parser_init.add_argument('--so-pin', help='SO-PIN number')  

And you have to add the parameter parents=[parent] in each subcommand where the --pin argument can be use.

Bye.

from pico-hsm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.