Skip to content

Commit 0b3b230

Browse files
Added a "--quiet" CLI option
1 parent a086c0c commit 0b3b230

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/cli/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function main(args: string[]): Promise<void> {
2828
process.on("unhandledRejection", errorHandler);
2929

3030
// Parse the command-line arguments
31-
let { help, version, options } = parseArgs(args);
31+
let { help, version, quiet, options } = parseArgs(args);
3232

3333
if (help) {
3434
// Show the help text and exit
@@ -41,6 +41,10 @@ export async function main(args: string[]): Promise<void> {
4141
process.exit(ExitCode.Success);
4242
}
4343
else {
44+
if (!quiet) {
45+
options.progress = progress;
46+
}
47+
4448
await bump(options);
4549
}
4650
}
@@ -54,7 +58,6 @@ export async function main(args: string[]): Promise<void> {
5458

5559
async function bump(options: VersionBumpOptions): Promise<void> {
5660
try {
57-
options.progress = progress;
5861
await versionBump(options);
5962
}
6063
catch (error) {

src/cli/parse-args.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { VersionBumpOptions } from "../version-bump-options";
99
export interface ParsedArgs {
1010
help?: boolean;
1111
version?: boolean;
12+
quiet?: boolean;
1213
options: VersionBumpOptions;
1314
}
1415

@@ -24,6 +25,7 @@ export function parseArgs(argv: string[]): ParsedArgs {
2425
{ name: "push", alias: "p", type: Boolean },
2526
{ name: "all", alias: "a", type: Boolean },
2627
{ name: "no-verify", type: Boolean },
28+
{ name: "quiet", alias: "q", type: Boolean },
2729
{ name: "version", alias: "v", type: Boolean },
2830
{ name: "help", alias: "h", type: Boolean },
2931
{ name: "files", type: String, multiple: true, defaultOption: true },
@@ -34,6 +36,7 @@ export function parseArgs(argv: string[]): ParsedArgs {
3436
let parsedArgs: ParsedArgs = {
3537
help: args.help as boolean,
3638
version: args.version as boolean,
39+
quiet: args.quiet as boolean,
3740
options: {
3841
preid: args.preid as string,
3942
commit: args.commit as string | boolean,

0 commit comments

Comments
 (0)