Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions bin/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import { parseArgs } from 'node:util';
import { execute } from '@oclif/core';

async function main(isProduction = false) {
const { positionals } = parseArgs({
const { positionals, values } = parseArgs({
allowPositionals: true,
strict: false, // Don't validate flags
options: {
version: { type: 'boolean', short: 'v' },
},
});

// If no arguments at all, default to help
if (positionals.length === 0) {
// If no arguments at all, default to help (but not if --version/-v was passed)
if (positionals.length === 0 && !values.version) {
process.argv.splice(2, 0, 'help');
}

Expand Down