Skip to content

Commit

Permalink
fix: explicitly define query command's param (#6899)
Browse files Browse the repository at this point in the history
the CLI command `query` had an implicit `query` positional
parameter and in earlier versions of yargs that was okay -
but in the later versions aiming for more correct code they've
refactored it to not support that

explicitly define the `query` positional parameter & add a
helpful description so people can tell what it is for

fixes #6896
  • Loading branch information
imnotjames committed Oct 14, 2020
1 parent 1ed7f50 commit 4475d80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/commands/QueryCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ import chalk from "chalk";
* Executes an sql query on the given connection.
*/
export class QueryCommand implements yargs.CommandModule {
command = "query";
command = "query [query]";
describe = "Executes given SQL query on a default connection. Specify connection name to run query on a specific connection.";

builder(args: yargs.Argv) {
return args
.positional("query", {
describe: "The SQL Query to run",
type: "string"
})
.option("c", {
alias: "connection",
default: "default",
Expand Down

0 comments on commit 4475d80

Please sign in to comment.