| 85 | |
| 86 | |
| 87 | def _get_parser(): |
| 88 | parser = argparse.ArgumentParser( |
| 89 | description=( |
| 90 | "The ptdump utility allows you look into the contents of your " |
| 91 | "PyTables files. It lets you see not only the data but also " |
| 92 | "the metadata (that is, the *structure* and additional " |
| 93 | "information in the form of *attributes*)." |
| 94 | ) |
| 95 | ) |
| 96 | |
| 97 | parser.add_argument( |
| 98 | "-v", |
| 99 | "--verbose", |
| 100 | action="store_true", |
| 101 | help="dump more metainformation on nodes", |
| 102 | ) |
| 103 | parser.add_argument( |
| 104 | "-d", |
| 105 | "--dump", |
| 106 | action="store_true", |
| 107 | help="dump data information on leaves", |
| 108 | ) |
| 109 | parser.add_argument( |
| 110 | "-a", |
| 111 | "--showattrs", |
| 112 | action="store_true", |
| 113 | help="show attributes in nodes (only useful when -v or -d are active)", |
| 114 | ) |
| 115 | parser.add_argument( |
| 116 | "-s", |
| 117 | "--sort", |
| 118 | action="store_true", |
| 119 | help="sort output by node name", |
| 120 | ) |
| 121 | parser.add_argument( |
| 122 | "-c", |
| 123 | "--colinfo", |
| 124 | action="store_true", |
| 125 | help="""show info of columns in tables (only useful when -v or -d |
| 126 | are active)""", |
| 127 | ) |
| 128 | parser.add_argument( |
| 129 | "-i", |
| 130 | "--idxinfo", |
| 131 | action="store_true", |
| 132 | help="""show info of indexed columns (only useful when -v or -d are |
| 133 | active)""", |
| 134 | ) |
| 135 | parser.add_argument( |
| 136 | "-R", |
| 137 | "--range", |
| 138 | dest="rng", |
| 139 | metavar="RANGE", |
| 140 | help=( |
| 141 | "select a RANGE of rows (in the form 'start,stop,step') " |
| 142 | "during the copy of *all* the leaves. " |
| 143 | "Default values are 'None, None, 1', which means a copy of all " |
| 144 | "the rows." |