Mercurial > hgrepos > Python > apps > py-cutils
comparison cutils/treesum.py @ 352:b256ae4f4bc8
treesum: implement the "filetypes" command to show all the filetype indicators that are used in digest output
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 01 Apr 2025 20:38:06 +0200 |
| parents | 3fa1b95d9498 |
| children | 5fffacc390eb |
comparison
equal
deleted
inserted
replaced
| 351:3e29b3e648d3 | 352:b256ae4f4bc8 |
|---|---|
| 265 "Or you can use the \"help\" subcommand like " | 265 "Or you can use the \"help\" subcommand like " |
| 266 "\"help COMMAND\". " | 266 "\"help COMMAND\". " |
| 267 "A list of valid commands and their short descriptions " | 267 "A list of valid commands and their short descriptions " |
| 268 "is listed below:", | 268 "is listed below:", |
| 269 metavar="COMMAND") | 269 metavar="COMMAND") |
| 270 | |
| 271 markerparser = subparsers.add_parser( | |
| 272 "filetypes", | |
| 273 help="Show the filetype indicators for all sorts of files", | |
| 274 description=walk.HELP_FILETYPE_INDICATORS, | |
| 275 formatter_class=argparse.RawDescriptionHelpFormatter, | |
| 276 add_help=False) | |
| 270 | 277 |
| 271 genparser = subparsers.add_parser( | 278 genparser = subparsers.add_parser( |
| 272 "generate", | 279 "generate", |
| 273 help="Generate checksums for directory trees", | 280 help="Generate checksums for directory trees", |
| 274 description="Generate checksums for directory trees.") | 281 description="Generate checksums for directory trees.") |
| 332 vparser.print_help() | 339 vparser.print_help() |
| 333 elif opts.help_command == "help": | 340 elif opts.help_command == "help": |
| 334 hparser.print_help() | 341 hparser.print_help() |
| 335 elif opts.help_command == "patterns": | 342 elif opts.help_command == "patterns": |
| 336 patparser.print_help() | 343 patparser.print_help() |
| 344 elif opts.help_command == "filetypes": | |
| 345 markerparser.print_help() | |
| 337 else: | 346 else: |
| 338 parser.print_help() | 347 parser.print_help() |
| 339 return 0 | 348 return 0 |
| 340 elif opts.subcommand == "patterns": | 349 elif opts.subcommand == "patterns": |
| 341 patparser.print_help() | 350 patparser.print_help() |
| 351 return 0 | |
| 352 elif opts.subcommand == "filetypes": | |
| 353 markerparser.print_help() | |
| 342 return 0 | 354 return 0 |
| 343 | 355 |
| 344 # Reparse strictly | 356 # Reparse strictly |
| 345 opts = parser.parse_args(args=argv) | 357 opts = parser.parse_args(args=argv) |
| 346 | 358 |
