Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parse: parser,
})
}
export const Flags = {
address: flags.build({
parse: parseAddress,
description: 'Account Address',
helpValue: '0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d',
}),
publicKey: flags.build({
parse: parsePublicKey,
description: 'Public Key',
helpValue: '0x',
}),
url: flags.build({
parse: parseUrl,
description: 'URL',
helpValue: 'htttps://www.celo.org',
}),
}
export const Args = {
address: argBuilder(parseAddress),
file: argBuilder(parsePath),
// TODO: Check that the file path is possible
newFile: argBuilder((x) => x),
}
export function argBuilder(parser: ParseFn): ArgBuilder {
return (name, args) => ({
name,
...args,
required: true,
parse: parser,
})
}
export const Flags = {
address: flags.build({
parse: parseAddress,
description: 'Account Address',
helpValue: '0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d',
}),
publicKey: flags.build({
parse: parsePublicKey,
description: 'Public Key',
helpValue: '0x',
}),
url: flags.build({
parse: parseUrl,
description: 'URL',
helpValue: 'htttps://www.celo.org',
}),
}
export const Args = {
address: argBuilder(parseAddress),
file: argBuilder(parsePath),
// TODO: Check that the file path is possible
newFile: argBuilder((x) => x),
import { flags } from "@oclif/command";
export const satoshiFlag = flags.build({
parse: input => {
const value = Number(input);
if (value < 1 / 1e8) {
throw new Error(`Expected number greater than 1 satoshi.`);
}
return value;
},
});
export const headless = flags.boolean({
description: `Run with headless chrome flags`,
default: false,
});
export const insights = flags.boolean({
description: `Analyze insights from command.`,
default: false,
});
export const debug = flags.boolean({
description: `Debug flag per command. Will output noisy command`,
default: false,
});
export const regressionThreshold = flags.build({
default: () => getDefaultValue('regressionThreshold'),
description: `The upper limit the experiment can regress slower in milliseconds. eg 100`,
parse: (ms): number => {
return parseInt(ms, 10);
},
});
export const iterations = flags.build({
default: () => getDefaultValue('iterations'),
description: `Number of runs`,
parse: iterations => {
parseInt(iterations, 10);
},
});
export const browserArgs = flags.build({
}
}
type Omit = Pick>
type ArgBuilder = (name: string, args?: Partial, 'name' | 'parse'>>) => IArg
export function argBuilder(parser: ParseFn): ArgBuilder {
return (name, args) => ({
name,
...args,
required: true,
parse: parser,
})
}
export const Flags = {
address: flags.build({
parse: parseAddress,
description: 'Account Address',
helpValue: '0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d',
}),
publicKey: flags.build({
parse: parsePublicKey,
description: 'Public Key',
helpValue: '0x',
}),
url: flags.build({
parse: parseUrl,
description: 'URL',
helpValue: 'htttps://www.celo.org',
}),
}
import { flags } from "@oclif/command"
import { getSavedAccessToken } from "./credentials"
export const env = flags.build({
name: "env",
description: "environment to use for commands",
default: () => process.env.FLY_ENV || process.env.NODE_ENV || "development"
})
export const app = flags.build({
name: "app",
char: "a",
description: "The app to run commands against",
env: "FLY_APP_NAME"
})
export const apiToken = flags.build({
name: "token",
description: "The api token to use. This will override the token created with `fly login` if present.",
env: "FLY_ACCESS_TOKEN"