style: apply oxfmt

This commit is contained in:
Peter Steinberger
2026-01-19 01:11:42 +00:00
parent 6a4b5fa4b5
commit 99bf65c539
5 changed files with 22 additions and 38 deletions

View File

@@ -45,19 +45,13 @@ export function getFlagValue(argv: string[], name: string): string | null | unde
return undefined;
}
export function getVerboseFlag(
argv: string[],
options?: { includeDebug?: boolean },
): boolean {
export function getVerboseFlag(argv: string[], options?: { includeDebug?: boolean }): boolean {
if (hasFlag(argv, "--verbose")) return true;
if (options?.includeDebug && hasFlag(argv, "--debug")) return true;
return false;
}
export function getPositiveIntFlagValue(
argv: string[],
name: string,
): number | null | undefined {
export function getPositiveIntFlagValue(argv: string[], name: string): number | null | undefined {
const raw = getFlagValue(argv, name);
if (raw === null || raw === undefined) return raw;
return parsePositiveInt(raw);

View File

@@ -197,8 +197,7 @@ export function registerChannelsCli(program: Command) {
.option("--account <id>", "Account id (accountId)")
.option("--verbose", "Verbose connection logs", false)
.action(async (opts) => {
await runChannelsCommandWithDanger(
async () => {
await runChannelsCommandWithDanger(async () => {
await runChannelLogin(
{
channel: opts.channel as string | undefined,
@@ -207,9 +206,7 @@ export function registerChannelsCli(program: Command) {
},
defaultRuntime,
);
},
"Channel login failed",
);
}, "Channel login failed");
});
channels
@@ -218,8 +215,7 @@ export function registerChannelsCli(program: Command) {
.option("--channel <channel>", "Channel alias (default: whatsapp)")
.option("--account <id>", "Account id (accountId)")
.action(async (opts) => {
await runChannelsCommandWithDanger(
async () => {
await runChannelsCommandWithDanger(async () => {
await runChannelLogout(
{
channel: opts.channel as string | undefined,
@@ -227,8 +223,6 @@ export function registerChannelsCli(program: Command) {
},
defaultRuntime,
);
},
"Channel logout failed",
);
}, "Channel logout failed");
});
}

View File

@@ -36,20 +36,20 @@ export function createMessageCliHelpers(
await runCommandWithRuntime(
defaultRuntime,
async () => {
await messageCommand(
{
...(() => {
const { account, ...rest } = opts;
return {
...rest,
accountId: typeof account === "string" ? account : undefined,
};
})(),
action,
},
deps,
defaultRuntime,
);
await messageCommand(
{
...(() => {
const { account, ...rest } = opts;
return {
...rest,
accountId: typeof account === "string" ? account : undefined,
};
})(),
action,
},
deps,
defaultRuntime,
);
},
(err) => {
defaultRuntime.error(danger(String(err)));