def add_pack_parser(parser):
parser.description = """The pack command creates an NDEF record
encapsulating the contents of FILE. The record type is determined
by the file type if possible, it may be explicitely set with the
-t option. The record name (payload identifier) is set to the file
name."""
parser.set_defaults(func=pack)
parser.add_argument(
"-o", dest="outfile", metavar="FILE",
type=argparse.FileType('w'), default="-",
help="save to file (writes binary data)")
parser.add_argument(
"-t", metavar="STRING", dest="type", default="unknown",
help="record type (default: mimetype)")
parser.add_argument(
"-n", metavar="STRING", dest="name", default=None,
help="record name (default: pathname)")
parser.add_argument(
"input", metavar="FILE", type=argparse.FileType('r'),
help="record data file ('-' to read from stdin)")
评论列表
文章目录