tpircher / pycrc

Free, easy to use Cyclic Redundancy Check (CRC) calculator and source code generator
https://pycrc.org
MIT License
31 stars 8 forks source link

Parsing model command line argument is broken #1

Closed m-kru closed 10 months ago

m-kru commented 1 year ago

The help says:

To generate the C source code and write it to filename:
    python pycrc.py [model] --generate c -o filename

  --model=MODEL         choose a parameter set from {crc-5, crc-8,
                        dallas-1-wire, crc-12-3gpp, crc-15, crc-16,
                        crc-16-usb, crc-16-modbus, crc-16-genibus,
                        crc-16-ccitt, r-crc-16, kermit, x-25, xmodem, zmodem,
                        crc-24, crc-32, crc-32c, crc-32-mpeg, crc-32-bzip2,
                        posix, jam, xfer, crc-64, crc-64-jones, crc-64-xz}

All of the below calls:

python src/pycrc.py jam --generate c -o crc.c

python src/pycrc.py "jam" --generate c -o crc.c

python src/pycrc.py --model=jam --generate c -o crc.c

python src/pycrc.py --model="jam" --generate c -o crc.c

python src/pycrc.py --model jam --generate c -o crc.c

python src/pycrc.py --model "jam" --generate c -o crc.c

return:

pycrc: warning: select an algorithm to be used in the generated file
m-kru commented 1 year ago

Ok, it is the help message that is wrong. --algorithm= is mandatory argument.