Created
February 12, 2022 10:51
-
-
Save Souvikns/1dff19a056e1f3680e65d1294a036fda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {main, options} from '@asyncapi/diff/cli'; | |
import Command from '../base'; | |
import {flags} from '@oclif/command'; | |
export default class Diff extends Command { | |
static flags = options.getFlags(flags); | |
static args = options.args; | |
async run(){ | |
const {args, flags} = this.parse(Diff); | |
await main(args, flags); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export async function main(args, flags){ | |
const firstDocumentPath = args['old']; | |
const secondDocumentPath = args['new']; | |
const outputFormat = flags['format']; | |
const outputType = flags['type']; | |
const overrideFilePath = flags['overrides']; | |
// Logic as diff requriements | |
} | |
export options = { | |
args: [ | |
{ | |
name: 'old', | |
description: 'old spec path, URL or context-name', | |
required: true, | |
}, | |
{ | |
name: 'new', | |
description: 'new spec path, URL or context-name', | |
required: true, | |
}, | |
]; | |
getFlags: (flags) => ({ | |
help: flags.help({ char: 'h' }), | |
format: flags.string({ | |
char: 'f', | |
description: 'format of the output', | |
default: 'json', | |
options: ['json'], | |
}), | |
type: flags.string({ | |
char: 't', | |
description: 'type of the output', | |
default: 'all', | |
options: ['breaking', 'non-breaking', 'unclassified', 'all'], | |
}), | |
overrides: flags.string({ | |
char: 'o', | |
description: 'path to JSON file containing the override properties', | |
}), | |
};) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment