<commit_before>#include "Client.h"
#include "Server/Server.h"
#include "Job/Remote.h"
#include "Job/StdInput.h"

#include <string>
#include <list>
#include <iostream>

#if defined(OS_WIN)
#include <io.h>
#include <fcntl.h>
#endif // OS_WIN

void printSizes()
{
    cefpdf::PageSizesMap::const_iterator it;

    for (it = cefpdf::pageSizesMap.begin(); it != cefpdf::pageSizesMap.end(); ++it) {
        std::cout << it->name <<  " " << it->width << "x" << it->height << std::endl;
    }
}

void printHelp(std::string name)
{
    std::cout << name << " v" << cefpdf::constants::version << std::endl;
    std::cout << "  Creates PDF files from HTML pages" << std::endl;
    std::cout << std::endl;
    std::cout << "Usage:" << std::endl;
    std::cout << "  cef-pdf [options] --url=<url>|--file=<path> [output]" << std::endl;
    std::cout << std::endl;
    std::cout << "Options:" << std::endl;
    std::cout << "  --help -h        This help screen." << std::endl;
    std::cout << "  --url=<url>      URL to load, may be http, file, data, anything supported by Chromium." << std::endl;
    std::cout << "  --file=<path>    File path to load using file:// scheme. May be relative to current directory." << std::endl;
    std::cout << "  --stdin          Read content from standard input until EOF (Unix: Ctrl+D, Windows: Ctrl+Z)." << std::endl;
    std::cout << "  --size=<spec>    Size (format) of the paper: A3, B2.. or custom <width>x<height> in mm." << std::endl;
    std::cout << "                   " << cefpdf::constants::pageSize << " is the default." << std::endl;
    std::cout << "  --list-sizes     Show all defined page sizes." << std::endl;
    std::cout << "  --landscape      Wheather to print with a landscape page orientation." << std::endl;
    std::cout << "                   Default is portrait." << std::endl;
    std::cout << "  --margin=<spec>  Paper margins in mm (much like CSS margin but without units)" << std::endl;
    std::cout << "                   If omitted some default margin is applied." << std::endl;
    std::cout << "  --javascript     Enable JavaScript." << std::endl;
    std::cout << "  --backgrounds    Print with backgrounds. Default is without." << std::endl;
    std::cout << std::endl;
    std::cout << "Server options:" << std::endl;
    std::cout << "  --server         Start HTTP server" << std::endl;
    std::cout << "  --host=<host>    If starting server, specify ip address to bind to." << std::endl;
    std::cout << "                   Default is " << cefpdf::constants::serverHost << std::endl;
    std::cout << "  --port=<port>    Specify server port number. Default is " << cefpdf::constants::serverPort << std::endl;
    std::cout << "  --remote-trigger Defer printing until page evaluates the following:" << std::endl;
    std::cout << "                   window.cefPdf({request: \"\", onSuccess: function () {}, onFailure: function () {}});" << std::endl;
    std::cout << std::endl;
    std::cout << "Output:" << std::endl;
    std::cout << "  PDF file name to create. Default is to write binary data to standard output." << std::endl;
    std::cout << std::endl;
}

std::string getExecutableName(CefRefPtr<CefCommandLine> commandLine)
{
    std::string program = commandLine->GetProgram().ToString();

    // Remove directory if present.
    // Do this before extension removal in case directory has a period character.
    const std::size_t s = program.find_last_of("\\/");<commit_msg>Moved remote-trigger help to correct section<commit_after>#include "Client.h"
#include "Server/Server.h"
#include "Job/Remote.h"
#include "Job/StdInput.h"

#include <string>
#include <list>
#include <iostream>

#if defined(OS_WIN)
#include <io.h>
#include <fcntl.h>
#endif // OS_WIN

void printSizes()
{
    cefpdf::PageSizesMap::const_iterator it;

    for (it = cefpdf::pageSizesMap.begin(); it != cefpdf::pageSizesMap.end(); ++it) {
        std::cout << it->name <<  " " << it->width << "x" << it->height << std::endl;
    }
}

void printHelp(std::string name)
{
    std::cout << name << " v" << cefpdf::constants::version << std::endl;
    std::cout << "  Creates PDF files from HTML pages" << std::endl;
    std::cout << std::endl;
    std::cout << "Usage:" << std::endl;
    std::cout << "  cef-pdf [options] --url=<url>|--file=<path> [output]" << std::endl;
    std::cout << std::endl;
    std::cout << "Options:" << std::endl;
    std::cout << "  --help -h        This help screen." << std::endl;
    std::cout << "  --url=<url>      URL to load, may be http, file, data, anything supported by Chromium." << std::endl;
    std::cout << "  --file=<path>    File path to load using file:// scheme. May be relative to current directory." << std::endl;
    std::cout << "  --stdin          Read content from standard input until EOF (Unix: Ctrl+D, Windows: Ctrl+Z)." << std::endl;
    std::cout << "  --size=<spec>    Size (format) of the paper: A3, B2.. or custom <width>x<height> in mm." << std::endl;
    std::cout << "                   " << cefpdf::constants::pageSize << " is the default." << std::endl;
    std::cout << "  --list-sizes     Show all defined page sizes." << std::endl;
    std::cout << "  --landscape      Wheather to print with a landscape page orientation." << std::endl;
    std::cout << "                   Default is portrait." << std::endl;
    std::cout << "  --margin=<spec>  Paper margins in mm (much like CSS margin but without units)" << std::endl;
    std::cout << "                   If omitted some default margin is applied." << std::endl;
    std::cout << "  --javascript     Enable JavaScript." << std::endl;
    std::cout << "  --backgrounds    Print with backgrounds. Default is without." << std::endl;
    std::cout << "  --remote-trigger Defer printing until page evaluates the following:" << std::endl;
    std::cout << "                   window.cefPdf({request: \"\", onSuccess: function () {}, onFailure: function () {}});" << std::endl;
    std::cout << std::endl;
    std::cout << "Server options:" << std::endl;
    std::cout << "  --server         Start HTTP server" << std::endl;
    std::cout << "  --host=<host>    If starting server, specify ip address to bind to." << std::endl;
    std::cout << "                   Default is " << cefpdf::constants::serverHost << std::endl;
    std::cout << "  --port=<port>    Specify server port number. Default is " << cefpdf::constants::serverPort << std::endl;
    std::cout << std::endl;
    std::cout << "Output:" << std::endl;
    std::cout << "  PDF file name to create. Default is to write binary data to standard output." << std::endl;
    std::cout << std::endl;
}

std::string getExecutableName(CefRefPtr<CefCommandLine> commandLine)
{
    std::string program = commandLine->GetProgram().ToString();

    // Remove directory if present.
    // Do this before extension removal in case directory has a period character.
    const std::size_t s = program.find_last_of("\\/");
{'fraction_non_alphanumeric': 0.18597604963208772, 'fraction_numerical': 0.0005771172990910403, 'mean_word_length': 3.046701692936369, 'pattern_counts': {'":': 0, '<': 319, '<?xml version=': 0, '>': 43, 'https://': 0, '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': '6108071', 'n_tokens_mistral': 2169, 'n_tokens_neox': 2152, 'n_words': 622}