Skip to content

Commit

Permalink
🧑‍💻 Make CLI colons optional on the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMiras committed Dec 4, 2024
1 parent ed2cf9c commit f264203
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ const createProgram = (): Command => {
.requiredOption("-m, --mac <macAddress>", "MAC address of the device")
).action(async (options) => {
const { username, password, mac } = options;
const normalizedMac = mac.replace(/:/g, "");
const pwd = password || (await promptPassword());
const jwtToken = await signIn(username, pwd);
const api = configure(); // Use the default API configuration
const deviceInfo = await api.deviceInfo(jwtToken, mac);
const deviceInfo = await api.deviceInfo(jwtToken, normalizedMac);
console.log("Device Info:", deviceInfo.data);
});
return program;
Expand Down

0 comments on commit f264203

Please sign in to comment.