27
# TODO: update usage string
28
print _("""5-a-day --add <bug numbers> add <bug numbers> to your 5-a-day
29
-f | --force force commit to the remote branch
30
--local only commit locally
32
5-a-day --update update ~/.signature with the bugs you've worked on
28
print _("""5-a-day --update update ~/.signature with the bugs you've worked on
33
29
--html update ~/.signature and print HTML signature
34
30
--yesterday update ~/.signature with yesterdays bugs
36
5-a-day --add-team(s) <team(s)> add your LoCo team
37
5-a-day --remove-team(s) <team(s)> remove <tag> from your team list
38
5-a-day --show-team(s) show current team(s)
40
5-a-day --add-tag(s) <tag(s)> tag subsequent bugs with <tag>
41
5-a-day --remove-tag(s) <tag(s)> remove <tag> from your tag list
42
5-a-day --show-tag(s) show current tag(s)""")
45
# TODO: Option "-n"/"--no-remote" to never update/commit the branch
33
- join https://launchpad.net/~5-a-day-participants
34
- run bzr launchpad-login <your Launchpad ID>""")
35
if glob.glob(os.path.expanduser("~")+"/.5-a-day*"):
36
print _(" - it's safe to remove all ~/.5-a-day*""")
95
64
"yesterday": False,
99
if o in ("-a", "--add"):
101
elif o in ("--add-tag", "--add-tags"):
102
commands.add("add-tags")
103
elif o in ("--add-team", "--add-teams"):
104
commands.add("add-teams")
105
elif o in ("-f", "--force"):
106
flags["force"] = True
107
elif o in ("--local"):
108
flags["local"] = True
109
elif o in ("-h", "--help"):
68
if o in ("-h", "--help"):
112
71
elif o in ("--html"):
113
72
flags["html"] = True
114
elif o in ("--remove-tag", "--remove-tags"):
115
commands.add("remove-tags")
116
elif o in ("--remove-team", "--remove-teams"):
117
commands.add("remove-teams")
118
elif o in ("--show-tag", "--show-tags"):
119
flags["show-tags"] = True
120
elif o in ("--show-team", "--show-teams"):
121
flags["show-teams"] = True
122
73
elif o in ("-u", "--update"):
123
74
flags["update"] = True
124
elif o in ("-v", "--verbose"):
125
flags["verbose"] = True
126
75
elif o in ("--yesterday"):
127
76
flags["yesterday"] = True
129
78
assert False, _("unhandled option")
131
if program_name == 'add-5-a-day':
133
80
if program_name == 'update-signatures':
134
81
flags["update"] = True
136
if flags["local"] and flags["force"]:
137
print _("E: The options --force (or -f) and --local exclude each other.")
138
sys.exit(COMMAND_LINE_SYNTAX_ERROR)
140
83
if len(commands) == 1 and len(args) == 0:
141
84
print _("E: You have to specify at least one argument.")
142
85
sys.exit(COMMAND_LINE_SYNTAX_ERROR)
144
if len(commands) > 1:
145
print _("E: You must not specify more than one of those tags: --add,"
146
" --add-tag, --add-team, --remove-tag, --remove-team")
147
return COMMAND_LINE_SYNTAX_ERROR
149
# data belongs to --add, --add-tag, --add-team, --remove-tag or --remove-team
150
87
return commands, flags, args