mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Add -r and -C aliases for --resume and --continue options
This commit is contained in:
@@ -206,6 +206,18 @@ describe('parseArguments', () => {
|
|||||||
expect(argv.prompt).toBeUndefined();
|
expect(argv.prompt).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should allow -r flag as alias for --resume', async () => {
|
||||||
|
process.argv = ['node', 'script.js', '-r', 'session-123'];
|
||||||
|
const argv = await parseArguments({} as Settings);
|
||||||
|
expect(argv.resume).toBe('session-123');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should allow -C flag as alias for --continue', async () => {
|
||||||
|
process.argv = ['node', 'script.js', '-C'];
|
||||||
|
const argv = await parseArguments({} as Settings);
|
||||||
|
expect(argv.continue).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
it('should convert positional query argument to prompt by default', async () => {
|
it('should convert positional query argument to prompt by default', async () => {
|
||||||
process.argv = ['node', 'script.js', 'Hi Gemini'];
|
process.argv = ['node', 'script.js', 'Hi Gemini'];
|
||||||
const argv = await parseArguments({} as Settings);
|
const argv = await parseArguments({} as Settings);
|
||||||
|
|||||||
@@ -422,12 +422,14 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
|
|||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
.option('continue', {
|
.option('continue', {
|
||||||
|
alias: 'C',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description:
|
description:
|
||||||
'Resume the most recent session for the current project.',
|
'Resume the most recent session for the current project.',
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
.option('resume', {
|
.option('resume', {
|
||||||
|
alias: 'r',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description:
|
description:
|
||||||
'Resume a specific session by its ID. Use without an ID to show session picker.',
|
'Resume a specific session by its ID. Use without an ID to show session picker.',
|
||||||
|
|||||||
Reference in New Issue
Block a user