// this script is the command line wrapper for checksum.k // usage: do_checksum.k [ ] ... [ ] // Example: do_checksum.k test.bin crc16 if(Size(ARGV)<3; PrintLn("Usage:"), PrintLn("do_checksum.k [ ] ... [ ]"), PrintLn("Example: do_checksum.k test.bin crc16"), PrintLn(), Error("wrong arguments") ); Load("checksum.k"); // evaluate command line arguments filename = ARGV[1]; method = Eval("'"+ARGV[2]+"(#)'"); // e.g. "crc16" -> 'crc16(#)' if(Size(ARGV)>3; // with segments, build segment list from ARGV first segments={}, for(i=0; i