Skip to content

Commit 527f906

Browse files
committed
🧪 添加cli测试
1 parent d76b827 commit 527f906

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎app/src/cli.tsx‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { writeTextFile } from "./utils/fs";
44
import { writeStdout } from "./utils/otherApi";
55

66
export async function runCli(matches: CliMatches) {
7+
if (matches.args.help?.occurrences > 0) {
8+
writeStdout(cliHelpText);
9+
return;
10+
}
711
if (matches.args.output?.occurrences > 0) {
812
const outputPath = matches.args.output?.value as string;
913
const outputFormat = outputPath.endsWith(".svg") || outputPath === "-" ? "svg" : "";
@@ -19,3 +23,14 @@ export async function runCli(matches: CliMatches) {
1923
}
2024
}
2125
}
26+
const cliHelpText = `
27+
____ _ __ ______ __
28+
/ __ \\_________ (_)__ _____/ \\/ ____/________ _____ / /_
29+
/ /_/ / ___/ __ \\ / / _ \\/ ___/ __\\/ __/ ___/ __ \\/ __ \\/ __ \\
30+
/ ____/ / / /_/ / / / __/ /__/ /_/ \\/_/ / / / /_/ / /_/ / / / /
31+
/_/ /_/ \\____/_/ /\\___/\\___/\\__\\/____/_/ \\__,_/ .___/_/ /_/
32+
/___/ /_/
33+
34+
https://project-graph.top/zh/features/cli
35+
36+
`;

0 commit comments

Comments
 (0)