microsoft/vscode-languagedetection

Public

mirrored fromhttps://github.com/microsoft/vscode-languagedetectionAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.0.23

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

cli/index.js

23lines · modecode

1#!/usr/bin/env node
2
3const { ModelOperations } = require('../dist/lib/index');
4const os = require('os');
5
6(function (params) {
7 console.warn('Note: this CLI is only for diagnosing the model results in @vscode/vscode-languagedetection. It should not be depended on in any production system.');
8 const args = process.argv.slice(2);
9 const content = args.join(os.EOL);
10
11 if (!content) {
12 console.error('No content specified. Please pass in the content as the first argument of invocation.');
13 return;
14 }
15
16 if (content.length <= 20) {
17 console.error('Not enough content specified. Please include more content in your invocation.');
18 return;
19 }
20
21 const modelOperations = new ModelOperations();
22 modelOperations.runModel(content).then((result) => console.log(result));
23})();
24