Skip to content

Commit ca714b5

Browse files
committed
add dummy cmd
1 parent 2403878 commit ca714b5

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/cli/cmd-ls.ts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Command } from "@commander-js/extra-typings";
2+
import { Logger } from "npmlog";
3+
import type { DebugLog } from "../domain/logging";
4+
import type { ReadTextFile } from "../io/fs";
5+
import { withErrorLogger } from "./error-logging";
6+
7+
/**
8+
* Makes the `openupm ls` cli command with the given dependencies.
9+
* @param readTextFile IO function for reading a text file.
10+
* @param debugLog IO function for debug-logs.
11+
* @param log Logger for cli output.
12+
* @returns The command.
13+
*/
14+
export function makeLsCmd(
15+
readTextFile: ReadTextFile,
16+
debugLog: DebugLog,
17+
log: Logger
18+
) {
19+
return new Command("ls")
20+
.aliases(["list"])
21+
.summary("list all currently installed packages")
22+
.description(
23+
`Print the names and versions of all installed packages.
24+
openupm ls`
25+
)
26+
.action(withErrorLogger(log, async function (options) {}));
27+
}

src/cli/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { fetchCheckUrlExists } from "../io/www";
1515
import { makeAddCmd } from "./cmd-add";
1616
import { makeDepsCmd } from "./cmd-deps";
1717
import { makeLoginCmd } from "./cmd-login";
18+
import { makeLsCmd } from "./cmd-ls";
1819
import { makeRemoveCmd } from "./cmd-remove";
1920
import { makeSearchCmd } from "./cmd-search";
2021
import { makeViewCmd } from "./cmd-view";
@@ -114,6 +115,8 @@ export function makeOpenupmCli(
114115
)
115116
);
116117

118+
program.addCommand(makeLsCmd(readTextFile, debugLog, log));
119+
117120
// prompt for invalid command
118121
program.on("command:*", function () {
119122
log.warn("", `unknown command: ${program.args.join(" ")}`);

0 commit comments

Comments
 (0)