Mercurial > hgrepos > Python > apps > py-cutils
comparison cutils/treesum.py @ 191:1b8bc876146a
Make "--debug" a global argument in treeview
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 16 Jan 2025 11:31:37 +0100 |
| parents | 7e0c25a31757 |
| children | fb36e71f6ba8 |
comparison
equal
deleted
inserted
replaced
| 190:7e0c25a31757 | 191:1b8bc876146a |
|---|---|
| 61 gp.add_argument( | 61 gp.add_argument( |
| 62 "--comment", action="append", default=[], | 62 "--comment", action="append", default=[], |
| 63 help="Put given comment COMMENT into the output as \"COMMENT\". " | 63 help="Put given comment COMMENT into the output as \"COMMENT\". " |
| 64 "Can be given more than once.") | 64 "Can be given more than once.") |
| 65 gp.add_argument( | 65 gp.add_argument( |
| 66 "--debug", action="store_true", | |
| 67 help="Activate debug logging to stderr") | |
| 68 gp.add_argument( | |
| 69 "--follow-directory-symlinks", "-l", action="store_true", | 66 "--follow-directory-symlinks", "-l", action="store_true", |
| 70 dest="follow_directory_symlinks", | 67 dest="follow_directory_symlinks", |
| 71 help="Follow symbolic links to directories when walking a " | 68 help="Follow symbolic links to directories when walking a " |
| 72 "directory tree. Note that this is different from using " | 69 "directory tree. Note that this is different from using " |
| 73 "\"--logical\" or \"--physical\" for arguments given " | 70 "\"--logical\" or \"--physical\" for arguments given " |
| 128 gp.add_argument( | 125 gp.add_argument( |
| 129 "directories", nargs="*", metavar="DIRECTORY") | 126 "directories", nargs="*", metavar="DIRECTORY") |
| 130 | 127 |
| 131 def _populate_info_arguments(ip): | 128 def _populate_info_arguments(ip): |
| 132 ip.add_argument( | 129 ip.add_argument( |
| 133 "--debug", action="store_true", | |
| 134 help="Activate debug logging to stderr") | |
| 135 ip.add_argument( | |
| 136 "--last", action="store_true", dest="print_only_last_block", | 130 "--last", action="store_true", dest="print_only_last_block", |
| 137 help="Print only the last block of every given input file") | 131 help="Print only the last block of every given input file") |
| 138 ip.add_argument( | 132 ip.add_argument( |
| 139 "digest_files", nargs="+", metavar="TREESUM-DIGEST-FILE") | 133 "digest_files", nargs="+", metavar="TREESUM-DIGEST-FILE") |
| 140 | 134 |
| 146 # | 140 # |
| 147 # Global options for all sub-commands. | 141 # Global options for all sub-commands. |
| 148 # In a group because this allows a customized title. | 142 # In a group because this allows a customized title. |
| 149 # | 143 # |
| 150 gparser = parser.add_argument_group(title="Global Options") | 144 gparser = parser.add_argument_group(title="Global Options") |
| 145 gparser.add_argument( | |
| 146 "--debug", action="store_true", | |
| 147 help="Activate debug logging to stderr") | |
| 151 gparser.add_argument( | 148 gparser.add_argument( |
| 152 "-v", "--version", action="version", | 149 "-v", "--version", action="version", |
| 153 version="%s (rv:%s)" % (__version__, __revision__), | 150 version="%s (rv:%s)" % (__version__, __revision__), |
| 154 help="Show program's version number and exit") | 151 help="Show program's version number and exit") |
| 155 gparser.add_argument( | 152 gparser.add_argument( |
