Skip to content

Commit 6dea7b1

Browse files
committed
file creation in today
1 parent 549a71b commit 6dea7b1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

leetcode/main.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
# TODO: random problem selector (from not accepted problems)
1919
# TODO: check the changes in question_content and apply them to the code in other files
2020
# TODO: use config without having to have a session
21+
# TODO: check all commands for errors
22+
# TODO: README - search - download - check - submit
23+
# TODO: leet problem -f displays erors
24+
# TODO: submit with only id (or filename)
2125

2226
def positive_integer(value):
2327
try:
@@ -62,6 +66,10 @@ def main():
6266

6367
today_problem_parser = subparsers.add_parser('today', help="Display today's problem.")
6468
today_problem_parser.set_defaults(func=QuestionOfToday)
69+
group_2 = today_problem_parser.add_mutually_exclusive_group()
70+
group_2.add_argument('-b', '--browser', action='store_true', help='Open the page in browser.')
71+
group_2.add_argument('-c', '--contents', action='store_true', help='Display contents of the question in the terminal.')
72+
group_2.add_argument('-f', '--file', action='store_true', help='Create a file with the problem content.')
6573

6674
submission_parser = subparsers.add_parser('submission', help="Download submission code")
6775
submission_parser.add_argument('id', type=int, help='ID of the problem.')
@@ -74,9 +82,7 @@ def main():
7482
submission_parser.add_argument('path', type=str, help='Path to the file with code answer')
7583
submission_parser.set_defaults(func=SendSubmission)
7684

77-
group_2 = today_problem_parser.add_mutually_exclusive_group()
78-
group_2.add_argument('-b', '--browser', action='store_true', help='Open the page in browser.')
79-
group_2.add_argument('-c', '--contents', action='store_true', help='Display contents of the question in the terminal.')
85+
8086

8187
args = parser.parse_args()
8288

0 commit comments

Comments
 (0)