Skip to content

Commit 11b571c

Browse files
committed
Cleanup and a bunch a bug fix in the cli.
1 parent f836f4f commit 11b571c

4 files changed

Lines changed: 4 additions & 15 deletions

File tree

cutekit/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def compileObjs(
337337
for rule in rules.rules.values():
338338
if rule.id == "cxx-scan":
339339
ddi += compileSrcs(w, scope, rule, srcs=scope.wilcard(rule.fileIn))
340-
elif rule.id not in ["cp", "ld", "ar", "cxx-collect", "cxx-modmap"]:
340+
elif rule.id not in ["cp", "ld", "ar", "cxx-collect"]:
341341
objs += compileSrcs(w, scope, rule, srcs=scope.wilcard(rule.fileIn))
342342
return objs, ddi
343343

cutekit/cli.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,8 @@ def usage(self) -> str:
850850
res += self.schema.usage()
851851

852852
if len(self.subcommands) == 1:
853-
res += "[subcommand] [args...]"
853+
name = next(iter(self.subcommands.keys()))
854+
res += f"{name} [args...]"
854855

855856
elif len(self.subcommands) > 0:
856857
res += "{"
@@ -891,10 +892,7 @@ def eval(self, args: list[str]):
891892

892893
if self.subcommands:
893894
if len(rest) > 0:
894-
if not self.populated:
895-
raise ValueError("Expected subcommand")
896-
else:
897-
self.lookupSubcommand(rest[0]).eval(rest)
895+
self.lookupSubcommand(rest[0]).eval(rest)
898896
else:
899897
print("Usage: " + cmd + self.usage(), end="\n\n")
900898
return

cutekit/model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ class Tool(DataClassJsonMixin):
642642
"ld-shared": Tool(shell.latest("clang++")),
643643
"cxx-scan": Tool(shell.latest("clang-scan-deps")),
644644
"cxx-collect": Tool("jq"),
645-
"cxx-modmap": Tool("ck --safemode tools cxx-modmap"),
646645
"cxx-dyndep": Tool("ck --safemode tools cxx-dyndep"),
647646
}
648647
"""Default tools available in all projects."""

cutekit/rules.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ class Rule:
6060
[],
6161
[],
6262
),
63-
"cxx-modmap": Rule(
64-
"cxx-modmap",
65-
["*.cpp"],
66-
"*.dd",
67-
"$obj --dir=$builddir --deps=$builddir/modules.ddi > $out.tmp && mv $out.tmp $out",
68-
[],
69-
[],
70-
),
7163
"cxx-dyndep": Rule(
7264
"cxx-dyndep",
7365
["*.dd"],

0 commit comments

Comments
 (0)