mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 13:34:15 -07:00
fix: resolve positional prompt argument being ignored with other flags (#9004)
This commit is contained in:
@@ -27,14 +27,20 @@ describe('extensions install command', () => {
|
||||
});
|
||||
|
||||
it('should fail if both git source and local path are provided', () => {
|
||||
const validationParser = yargs([]).command(installCommand).fail(false);
|
||||
const validationParser = yargs([])
|
||||
.command(installCommand)
|
||||
.fail(false)
|
||||
.locale('en');
|
||||
expect(() =>
|
||||
validationParser.parse('install some-url --path /some/path'),
|
||||
).toThrow('Arguments source and path are mutually exclusive');
|
||||
});
|
||||
|
||||
it('should fail if both auto update and local path are provided', () => {
|
||||
const validationParser = yargs([]).command(installCommand).fail(false);
|
||||
const validationParser = yargs([])
|
||||
.command(installCommand)
|
||||
.fail(false)
|
||||
.locale('en');
|
||||
expect(() =>
|
||||
validationParser.parse(
|
||||
'install some-url --path /some/path --auto-update',
|
||||
|
||||
@@ -27,14 +27,14 @@ describe('extensions new command', () => {
|
||||
});
|
||||
|
||||
it('should fail if no path is provided', async () => {
|
||||
const parser = yargs([]).command(newCommand).fail(false);
|
||||
const parser = yargs([]).command(newCommand).fail(false).locale('en');
|
||||
await expect(parser.parseAsync('new')).rejects.toThrow(
|
||||
'Not enough non-option arguments: got 0, need at least 2',
|
||||
);
|
||||
});
|
||||
|
||||
it('should fail if no template is provided', async () => {
|
||||
const parser = yargs([]).command(newCommand).fail(false);
|
||||
const parser = yargs([]).command(newCommand).fail(false).locale('en');
|
||||
await expect(parser.parseAsync('new /some/path')).rejects.toThrow(
|
||||
'Not enough non-option arguments: got 1, need at least 2',
|
||||
);
|
||||
|
||||
@@ -10,7 +10,10 @@ import yargs from 'yargs';
|
||||
|
||||
describe('extensions uninstall command', () => {
|
||||
it('should fail if no source is provided', () => {
|
||||
const validationParser = yargs([]).command(uninstallCommand).fail(false);
|
||||
const validationParser = yargs([])
|
||||
.command(uninstallCommand)
|
||||
.fail(false)
|
||||
.locale('en');
|
||||
expect(() => validationParser.parse('uninstall')).toThrow(
|
||||
'Not enough non-option arguments: got 0, need at least 1',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user