Skip to content

Commit 58d0dca

Browse files
committed
Change command argument from "<path>" to "<manifest-path>"
This is to provide better readability when --help is used. The command line "office-addin-manifest --help" will display: -------------------- Usage: manifest [options] [command] Options: -h, --help output usage information Commands: info <manifest-path> modify [options] <manifest-path> -------------------- The command line "office-addin-manifest info --help" will display: -------------------- Usage: info [options] <manifest-path> --------------------
1 parent 1002589 commit 58d0dca

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

packages/office-addin-manifest/src/commands.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
import * as commnder from "commander";
55
import * as manifestInfo from "./manifestInfo";
66

7-
export async function info(path: string) {
7+
export async function info(manifestPath: string) {
88
try {
9-
const manifest = await manifestInfo.readManifestFile(path);
10-
logManifestInfo(path, manifest);
9+
const manifest = await manifestInfo.readManifestFile(manifestPath);
10+
logManifestInfo(manifestPath, manifest);
1111
} catch (err) {
1212
console.error(`Error: ${err}`);
1313
}
1414
}
1515

16-
function logManifestInfo(path: string, manifest: manifestInfo.ManifestInfo) {
17-
console.log(`Manifest: ${path}`);
16+
function logManifestInfo(manifestPath: string, manifest: manifestInfo.ManifestInfo) {
17+
console.log(`Manifest: ${manifestPath}`);
1818
console.log(` Id: ${manifest.id || ""}`);
1919
console.log(` Name: ${manifest.displayName || ""}`);
2020
console.log(` Provider: ${manifest.providerName || ""}`);
@@ -24,7 +24,7 @@ function logManifestInfo(path: string, manifest: manifestInfo.ManifestInfo) {
2424
console.log(` Description: ${manifest.description || ""}`);
2525
}
2626

27-
export async function modify(path: string, command: commnder.Command) {
27+
export async function modify(manifestPath: string, command: commnder.Command) {
2828
try {
2929
const guid: string | undefined = (command.guid) ? command.guid : undefined;
3030
const displayName: string | undefined = (command.displayName) ? command.displayName : undefined;
@@ -33,8 +33,8 @@ export async function modify(path: string, command: commnder.Command) {
3333
throw new Error("You need to specify something to change in the manifest.");
3434
}
3535

36-
const manifest = await manifestInfo.modifyManifestFile(path, guid, displayName);
37-
logManifestInfo(path, manifest);
36+
const manifest = await manifestInfo.modifyManifestFile(manifestPath, guid, displayName);
37+
logManifestInfo(manifestPath, manifest);
3838
} catch (err) {
3939
console.error(`Error: ${err}`);
4040
}

packages/office-addin-manifest/src/manifest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import * as commands from "./commands";
88

99
if (process.argv[1].endsWith("\\manifest.js")) {
1010
commander
11-
.command("info <path>")
11+
.command("info <manifest-path>")
1212
.action(commands.info);
1313

1414
commander
15-
.command("modify <path>")
15+
.command("modify <manifest-path>")
1616
.option("-g,--guid [guid]", "Change the guid. Specify \"random\" for a random guid.")
1717
.option("-d, --displayName [name]", "Display name for the add-in.")
1818
.action(commands.modify);

0 commit comments

Comments
 (0)