Skip to content

Commit baab9b3

Browse files
akrantzAdam KrantzmillerdsRick-Kirkham
authored
convertToSingleHost.js shows usage if no args given (#259)
convertToSingleHost.js shows usage if no arguments are given Co-authored-by: Adam Krantz <adamk@microsoft.com> Co-authored-by: Darren Miller <millerds@users.noreply.github.com> Co-authored-by: Rick Kirkham <Rick-Kirkham@users.noreply.github.com>
1 parent efa6e1f commit baab9b3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

convertToSingleHost.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,24 @@ const fs = require("fs");
44
const path = require("path");
55
const util = require("util");
66
const childProcess = require("child_process");
7+
const hosts = ["excel", "onenote", "outlook", "powerpoint", "project", "word"];
8+
9+
if (process.argv.length <= 2) {
10+
const hostList = hosts.map((host) => `'${host}'`).join(", ");
11+
console.log("SYNTAX: convertToSingleHost.js <host> <manifestType> <projectName> <appId>");
12+
console.log();
13+
console.log(` host (required): Specifies which Office app will host the add-in: ${hostList}`);
14+
console.log(` manifestType: Specify the type of manifest to use: 'xml' or 'json'. Defaults to 'xml'`);
15+
console.log(` projectName: The name of the project (use quotes when there are spaces in the name). Defaults to 'My Office Add-in'`);
16+
console.log(` appId: The id of the project or 'random' to generate one. Defaults to 'random'`);
17+
console.log();
18+
process.exit(1);
19+
}
720

821
const host = process.argv[2];
922
const manifestType = process.argv[3];
1023
const projectName = process.argv[4];
1124
let appId = process.argv[5];
12-
const hosts = ["excel", "onenote", "outlook", "powerpoint", "project", "word"];
1325
const testPackages = [
1426
"@types/mocha",
1527
"@types/node",

0 commit comments

Comments
 (0)