Skip to content

Commit e5f5553

Browse files
refactor: Rename --local to --dev, align with check50
- Change --local to --dev (-d) for both check and submit commands - Match check50's development mode semantics: * --dev interprets slug as literal path to checks directory * Aligns with check50's -d/--dev flag behavior - Update all references in code and error messages - Update integration tests to use -d flag - All 129 tests passing Breaking change: Users must now use -d/--dev instead of --local
1 parent 3b1822f commit e5f5553

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

bootcs/__main__.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,17 @@ def main():
4343
help="Language for checks (auto-detected from files if not specified)")
4444
check_parser.add_argument("-u", "--update", action="store_true",
4545
help="Force update checks from remote")
46-
check_parser.add_argument("--local", metavar="PATH", help="Path to local checks directory")
46+
check_parser.add_argument("-d", "--dev", metavar="PATH",
47+
help="Development mode: PATH is interpreted as a literal path to checks directory")
4748

4849
# Submit command
4950
submit_parser = subparsers.add_parser("submit", help="Submit your code")
5051
submit_parser.add_argument("slug", help="The submission slug (e.g., cs50/hello)")
5152
submit_parser.add_argument("-m", "--message", help="Commit message")
5253
submit_parser.add_argument("-y", "--yes", action="store_true", help="Skip confirmation")
5354
submit_parser.add_argument("-L", "--language", help="Language of submission (auto-detected if not specified)")
54-
submit_parser.add_argument("--local", metavar="PATH", help="Path to local checks directory (for file list)")
55+
submit_parser.add_argument("-d", "--dev", metavar="PATH",
56+
help="Development mode: PATH is literal path to checks directory (for file list)")
5557
submit_parser.add_argument("--async", dest="async_mode", action="store_true",
5658
help="Don't wait for evaluation result (return immediately)")
5759
submit_parser.add_argument("--timeout", type=int, default=60,
@@ -181,16 +183,16 @@ def run_check(args):
181183
language = detect_language(directory=Path.cwd(), explicit=explicit_lang)
182184

183185
# Determine check directory
184-
if args.local:
185-
# Combine local path with slug (e.g., /path/to/checks + cs50/hello)
186-
check_dir = Path(args.local).resolve() / slug
186+
if args.dev:
187+
# Development mode: combine dev path with slug (e.g., /path/to/checks + cs50/hello)
188+
check_dir = Path(args.dev).resolve() / slug
187189
else:
188190
# Try remote download first, then fall back to local search
189191
check_dir = find_check_dir(slug, language=language, force_update=force_update)
190192

191193
if not check_dir or not check_dir.exists():
192194
termcolor.cprint(f"Error: Could not find checks for '{slug}'", "red", file=sys.stderr)
193-
termcolor.cprint("Use --local to specify a local checks directory.", "yellow", file=sys.stderr)
195+
termcolor.cprint("Use --dev to specify a checks directory for development.", "yellow", file=sys.stderr)
194196
return 1
195197

196198
# Set internal state
@@ -526,14 +528,14 @@ def run_submit(args):
526528
token = get_token()
527529

528530
# Determine check directory for file list
529-
if args.local:
530-
check_dir = Path(args.local).resolve()
531+
if args.dev:
532+
check_dir = Path(args.dev).resolve()
531533
else:
532534
check_dir = find_check_dir(slug, language=language)
533535

534536
if not check_dir or not check_dir.exists():
535537
termcolor.cprint(f"Error: Could not find config for '{slug}'", "red", file=sys.stderr)
536-
termcolor.cprint("Use --local to specify the checks directory.", "yellow", file=sys.stderr)
538+
termcolor.cprint("Use --dev to specify the checks directory for development.", "yellow", file=sys.stderr)
537539
return 1
538540

539541
# Load config to get file list

tests/unit/test_hello_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _run_check(self, student_dir: Path, language: str) -> subprocess.CompletedPr
6565
sys.executable, "-m", "bootcs",
6666
"check", "cs50/hello",
6767
"-L", language,
68-
"--local", str(self.checks_dir.parent.parent)
68+
"-d", str(self.checks_dir.parent.parent)
6969
]
7070

7171
env = os.environ.copy()

0 commit comments

Comments
 (0)