|
1 | 1 | #!/usr/bin/env node |
| 2 | +// @ts-check |
2 | 3 |
|
3 | 4 | import { runProgram } from '@black-flag/core'; |
4 | 5 |
|
5 | | -export default runProgram(import.meta.resolve('./commands')); |
| 6 | +export default runProgram(import.meta.resolve('./commands'), { |
| 7 | + configureArguments(rawArgv, context) { |
| 8 | + console.log('configureArguments -> rawArgv:', rawArgv); |
| 9 | + console.log('configureArguments -> context:', context); |
| 10 | + return rawArgv; |
| 11 | + }, |
| 12 | + configureErrorHandlingEpilogue(meta, argv, _context) { |
| 13 | + console.log('configureErrorHandlingEpilogue -> meta:', meta); |
| 14 | + console.log('configureErrorHandlingEpilogue -> argv:', argv); |
| 15 | + console.log('configureErrorHandlingEpilogue -> context:', '(the same)'); |
| 16 | + }, |
| 17 | + configureExecutionContext(context) { |
| 18 | + context.customContextKey = { custom: 'value' }; |
| 19 | + console.log('configureExecutionContext -> context:', context); |
| 20 | + return context; |
| 21 | + }, |
| 22 | + configureExecutionEpilogue(argv, _context) { |
| 23 | + console.log('configureExecutionEpilogue -> argv:', argv); |
| 24 | + console.log('configureExecutionEpilogue -> context:', '(the same)'); |
| 25 | + return argv; |
| 26 | + }, |
| 27 | + configureExecutionPrologue(rootPrograms, _context) { |
| 28 | + console.log('configureExecutionPrologue -> rootPrograms:', rootPrograms); |
| 29 | + console.log('configureExecutionPrologue -> context:', '(the same)'); |
| 30 | + } |
| 31 | +}); |
0 commit comments