MCPcopy Create free account
hub / github.com/awsdocs/aws-doc-sdk-examples / loadArgs

Function loadArgs

javascriptv3/example_code/ec2/scenarios/basic.js:137–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135} from "@aws-doc-sdk-examples/lib/utils/util-node.js";
136
137const loadArgs = () => {
138 const options = {
139 help: {
140 type: "boolean",
141 },
142 confirmAll: {
143 type: "boolean",
144 description: "Skip user input.",
145 },
146 noArt: {
147 type: "boolean",
148 description: "Do not display ASCII art or text decorations.",
149 },
150 };
151 const results = parseArgs({ options });
152 const { errors } = validateArgs({ options }, results);
153 if (results.values.help) {
154 printManPage(options, {
155 name: "EC2 Basics",
156 description: "Learn the basic SDK commands for Amazon EC2.",
157 synopsis: "node basics.js [OPTIONS]",
158 });
159 }
160 return { errors, results };
161};
162
163if (isMain(import.meta.url)) {
164 const { errors, results } = loadArgs();

Callers 1

basic.jsFile · 0.70

Calls 2

validateArgsFunction · 0.90
printManPageFunction · 0.90

Tested by

no test coverage detected