if __name__ == "__main__":
parser = OptionParser()
group = OptionGroup(parser, "Merge Options",
"By default, only issues with status "
"['To Test' and 'Pending'] will be merged")
group.add_option("--merge-status-in-progress",
action="store_true",
dest="merge_in_progress",
default=False,
help="Merge issue branches with status"
"In progress + 100 % [default: False]")
group.add_option("--merge-all-outdated-branches",
action="store_true",
dest="merge_all_outdated_branches",
default=False,
help="Merge all outdated branches")
parser.add_option_group(group)
(options, args) = parser.parse_args()
if options.merge_all_outdated_branches:
sys.exit(merge_outdated_branches())
sys.exit(auto_merge(options.merge_in_progress))
action="store_true" аргумент без параметров (--a)
action="store" аргумент с параметрами (--a 10)
Комментариев нет:
Отправить комментарий