<commit_before>#!/usr/bin/env node

var fs = require('fs');
var path = require('path');
var argv = require('nomnom')
  .script('ldnode')
  .option('verbose', {
    abbr: 'v',
    flag: true,
    help: 'Print the logs to console'
  })
  .option('version', {
    flag: true,
    help: 'Print current ldnode version',
    callback: function () {
      fs.readFile(path.resolve(__dirname, '../package.json'), 'utf-8', function(err, file) {
        console.log(JSON.parse(file).version);
      });
    }
  })
  .option('mount', {
    abbr: 'm',
    help: 'Where to mount Linked Data Platform (default: \'/\')'
  })
  .option('root', {
    abbr: 'r',
    help: 'Root location on the filesystem to serve resources'
  })
  .option('port', {
    abbr: 'p',
    help: 'Port to use'
  })
  .option('cache', {
    abbr: 'c',
    help: 'Set cache time (in seconds), 0 for no cache'
  })
  .option('key', {
    help: 'Path to the ssl key',
    abbr: 'K',
    full: 'key'
  })
  .option('cert', {
    full: 'cert',
    help: 'Path to the ssl cert',
    abbr: 'C'
  })
  .option('webid', {
    help: 'Enable WebID+TLS authentication',
    full: 'webid',
    flag: true
  })
  .option('secret', {
    help: 'HTTP Session secret key (e.g. "your secret phrase")',
    abbr: 's'
  })
  .option('proxy', {
    full: 'proxy',
    help: 'Use a proxy on example.tld/proxyPath',
    abbr: 'P'
  })
  .option('noLive', {
    full: 'no-live',
    help: 'Disable live support through WebSockets',
    flag: true
  })
  .option('suffixAcl', {
    full: 'suffix-acl',
    help: 'Suffix for acl files (default: \'.acl\')',
    abbr: 'sA'
  })
  .option('suffixMeta', {
    full: 'suffix-meta',
    help: 'Suffix for metadata files (default: \'.meta\')',
    abbr: 'sM'
  })
  .option('suffixSSE', {
    full: 'suffix-sse',
    help: 'Suffix for SSE files (default: \'.events\')',
    abbr: 'sE'
  })
  .option('noErrorPages', {
    full: 'no-error-pages',
    flag: true,
    help: 'Disable custom error pages (use Node.js default pages instead)'
  })
  .option('errorPages', {
    full: 'error-pages',
    help: 'Folder from which to look for custom error pages files (files must be named <error-code>.html -- eg. 500.html)'
  })
  .option('skin', {
    help: 'URI to a skin to load (default: https://linkeddata.github.io/warp/#/list/)'
  })
  .parse();

// Print version and leave
if (argv.version) {
  return;
}

// Set up --no-*
argv.live = !argv.noLive;

// Set up debug environment
process.env.DEBUG = argv.verbose ? 'ldnode:*' : false;
var debug = require('../lib/debug').server;

// Set up port
argv.port = argv.port || 3456;

// Signal handling (e.g. CTRL+C)
if (process.platform !== 'win32') {
    // Signal handlers don't work on Windows.
    process.on('SIGINT', function() {
        debug("LDP stopped.");
        process.exit();
    });
}

// Finally starting ldnode
var ldnode = require('../');
var app;
try {
  app = ldnode.createServer(argv);
} catch(e) {
  console.log(e.message);
  console.log(e.stack)
  return 1;
}
app.listen(argv.port, function() {
    debug('LDP started on port ' + argv.port);
});
<commit_msg>adding Identity Provider to command line<commit_after>#!/usr/bin/env node

var fs = require('fs');
var path = require('path');
var argv = require('nomnom')
  .script('ldnode')
  .option('verbose', {
    abbr: 'v',
    flag: true,
    help: 'Print the logs to console'
  })
  .option('version', {
    flag: true,
    help: 'Print current ldnode version',
    callback: function () {
      fs.readFile(path.resolve(__dirname, '../package.json'), 'utf-8', function(err, file) {
        console.log(JSON.parse(file).version);
      });
    }
  })
  .option('mount', {
    abbr: 'm',
    help: 'Where to mount Linked Data Platform (default: \'/\')'
  })
  .option('root', {
    abbr: 'r',
    help: 'Root location on the filesystem to serve resources'
  })
  .option('port', {
    abbr: 'p',
    help: 'Port to use'
  })
  .option('cache', {
    abbr: 'c',
    help: 'Set cache time (in seconds), 0 for no cache'
  })
  .option('key', {
    help: 'Path to the ssl key',
    abbr: 'K',
    full: 'key'
  })
  .option('cert', {
    full: 'cert',
    help: 'Path to the ssl cert',
    abbr: 'C'
  })
  .option('webid', {
    help: 'Enable WebID+TLS authentication',
    full: 'webid',
    flag: true
  })
  .option('idp', {
    help: 'Allow registration of WebIDs',
    abbr: 'idp',
    full: 'identity-provider',
    flag: true
  })
  .option('secret', {
    help: 'HTTP Session secret key (e.g. "your secret phrase")',
    abbr: 's'
  })
  .option('proxy', {
    full: 'proxy',
    help: 'Use a proxy on example.tld/proxyPath',
    abbr: 'P'
  })
  .option('noLive', {
    full: 'no-live',
    help: 'Disable live support through WebSockets',
    flag: true
  })
  .option('suffixAcl', {
    full: 'suffix-acl',
    help: 'Suffix for acl files (default: \'.acl\')',
    abbr: 'sA'
  })
  .option('suffixMeta', {
    full: 'suffix-meta',
    help: 'Suffix for metadata files (default: \'.meta\')',
    abbr: 'sM'
  })
  .option('suffixSSE', {
    full: 'suffix-sse',
    help: 'Suffix for SSE files (default: \'.events\')',
    abbr: 'sE'
  })
  .option('noErrorPages', {
    full: 'no-error-pages',
    flag: true,
    help: 'Disable custom error pages (use Node.js default pages instead)'
  })
  .option('errorPages', {
    full: 'error-pages',
    help: 'Folder from which to look for custom error pages files (files must be named <error-code>.html -- eg. 500.html)'
  })
  .option('skin', {
    help: 'URI to a skin to load (default: https://linkeddata.github.io/warp/#/list/)'
  })
  .parse();

// Print version and leave
if (argv.version) {
  return;
}

// Set up --no-*
argv.live = !argv.noLive;

// Set up debug environment
process.env.DEBUG = argv.verbose ? 'ldnode:*' : false;
var debug = require('../lib/debug').server;

// Set up port
argv.port = argv.port || 3456;

// Signal handling (e.g. CTRL+C)
if (process.platform !== 'win32') {
    // Signal handlers don't work on Windows.
    process.on('SIGINT', function() {
        debug("LDP stopped.");
        process.exit();
    });
}

// Finally starting ldnode
var ldnode = require('../');
var app;
try {
  app = ldnode.createServer(argv);
} catch(e) {
  console.log(e.message);
  console.log(e.stack)
  return 1;
}
app.listen(argv.port, function() {
    debug('LDP started on port ' + argv.port);
});

{'fraction_non_alphanumeric': 0.18830556428795975, 'fraction_numerical': 0.003772398616787174, 'mean_word_length': 2.7429411764705884, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6761643', 'n_tokens_mistral': 2317, 'n_tokens_neox': 2259, 'n_words': 617}