Skip to content

Commit

Permalink
fix: align cli options with README
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Jul 21, 2023
1 parent 3c755f6 commit 4f3432c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/cli/commands/database/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ export class DatabaseCreateCommand implements CommandModule {
.option('tsconfig', {
alias: 'tc',
default: 'tsconfig.json',
describe: 'Name (incl. relative path) of the tsconfig file.',
describe: 'Name (or relative path incl. name) of the tsconfig file.',
})
.option('dataSource', {
alias: 'd',
default: 'data-source',
describe: 'Name (incl. relative path) of the data-source file.',
describe: 'Name (or relative path incl. name) of the data-source file.',
})
.option('synchronize', {
alias: 's',
Expand Down
4 changes: 2 additions & 2 deletions src/cli/commands/database/drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export class DatabaseDropCommand implements CommandModule {
.option('tsconfig', {
alias: 'tc',
default: 'tsconfig.json',
describe: 'Name (incl. relative path) of the tsconfig file.',
describe: 'Name (or relative path incl. name) of the tsconfig file.',
})
.option('dataSource', {
alias: 'd',
default: 'data-source',
describe: 'Name (incl. relative path) of the data-source file.',
describe: 'Name (or relative path incl. name) of the data-source file.',
})
.option('initialDatabase', {
describe: 'Specify the initial database to connect to.',
Expand Down
13 changes: 9 additions & 4 deletions src/cli/commands/seed/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export interface SeedCreateArguments extends Arguments {
root: string;
javascript: boolean;
timestamp?: number,
path: string
name: string
}

export class SeedCreateCommand implements CommandModule {
command = 'seed:create <path>';
command = 'seed:create';

describe = 'Create a seeder file';
describe = 'Create a seeder file.';

builder(args: Argv) {
return args
Expand All @@ -36,6 +36,11 @@ export class SeedCreateCommand implements CommandModule {
type: 'boolean',
default: false,
describe: 'Generate a seeder file for JavaScript instead of TypeScript.',
})
.option('name', {
alias: 'n',
describe: 'Name (or relative path incl. name) of the seeder.',
demandOption: true,
});
}

Expand All @@ -49,7 +54,7 @@ export class SeedCreateCommand implements CommandModule {
timestamp = args.timestamp;
}

const sourcePath = parseFilePath(args.path, args.root);
const sourcePath = parseFilePath(args.name, args.root);

const dirNameIsDirectory = await isDirectory(sourcePath.directory);
if (!dirNameIsDirectory) {
Expand Down
6 changes: 3 additions & 3 deletions src/cli/commands/seed/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ export class SeedRunCommand implements CommandModule {
.option('tsconfig', {
alias: 'tc',
default: 'tsconfig.json',
describe: 'Name (incl. relative path) of the tsconfig file.',
describe: 'Name (or relative path incl. name) of the tsconfig file.',
})
.option('dataSource', {
alias: 'd',
default: 'data-source',
describe: 'Name (incl. relative path) of the data-source file.',
describe: 'Name (or relative path incl. name) of the data-source file.',
})
.option('name', {
alias: 'n',
describe: 'Name of the seeder class.',
describe: 'Name (or relative path incl. name) of the seeder.',
});
}

Expand Down

0 comments on commit 4f3432c

Please sign in to comment.