Skip to content

Commit

Permalink
fix: short options, disable analytics logs (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 authored Sep 8, 2023
1 parent 632cb36 commit 94a2dc9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/commands/create-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const templates = [
},
];

const templateOption = new Option("-t, --template <name>", "Project template to use").choices(
const templateOption = new Option("--t, --template <name>", "Project template to use").choices(
templates.map((template) => template.value)
);

Expand Down
5 changes: 1 addition & 4 deletions src/commands/withdraw-finalize.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Option } from "commander";
import { prompt } from "inquirer";

import { l1RpcUrlOption, l2RpcUrlOption, privateKeyOption, zeekOption } from "../common/options";
import { chainOption, l1RpcUrlOption, l2RpcUrlOption, privateKeyOption, zeekOption } from "../common/options";
import { l2Chains } from "../data/chains";
import { program } from "../setup";
import { track } from "../utils/analytics";
Expand All @@ -19,9 +19,6 @@ import zeek from "../utils/zeek";

import type { DefaultTransactionOptions } from "../common/options";

const chainOption = new Option("-c, --chain <chain>", "Chain to use").choices(
l2Chains.filter((e) => e.l1Chain).map((chain) => chain.network)
);
const transactionHashOption = new Option("--hash <transaction_hash>", "L2 withdrawal transaction hash to finalize");

type WithdrawFinalizeOptions = DefaultTransactionOptions & {
Expand Down
8 changes: 4 additions & 4 deletions src/common/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { Option } from "commander";

import { l2Chains } from "../data/chains";

export const chainOption = new Option("-c, --chain <chain>", "Chain to use").choices(
export const chainOption = new Option("--c, --chain <chain>", "Chain to use").choices(
l2Chains.filter((e) => e.l1Chain).map((chain) => chain.network)
);
export const l1RpcUrlOption = new Option("--l1-rpc, --l1-rpc-url <URL>", "Override L1 RPC URL");
export const l2RpcUrlOption = new Option("--l2-rpc, --l2-rpc-url <URL>", "Override L2 RPC URL");
export const privateKeyOption = new Option("-pk, --private-key <URL>", "Private key of the sender");
export const privateKeyOption = new Option("--pk, --private-key <URL>", "Private key of the sender");
export const amountOptionCreate = (action: string) =>
new Option("--amount <amount>", `Amount of ETH to ${action} (eg. 0.1)`);
new Option("--a, --amount <amount>", `Amount of ETH to ${action} (eg. 0.1)`);
export const recipientOptionCreate = (recipientLocation: string) =>
new Option("--recipient <address>", `Recipient address on ${recipientLocation} (0x address)`);
new Option("--to, --recipient <address>", `Recipient address on ${recipientLocation} (0x address)`);
export const zeekOption = new Option(
"--zeek",
"zeek, the dev cat, will search for an inspirational quote and provide to you at the end of any command"
Expand Down
1 change: 1 addition & 0 deletions src/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let client: RudderAnalytics | undefined;
try {
client = new RudderAnalytics(process.env.RUDDER_STACK_KEY!, {
dataPlaneUrl: process.env.RUDDER_STACK_DATAPLANE_URL!,
logLevel: "error",
});
} catch {
// ignore
Expand Down

0 comments on commit 94a2dc9

Please sign in to comment.