<commit_before>#include "command.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "eval.hh"
#include "json.hh"
#include "value-to-json.hh"
#include "progress-bar.hh"

using namespace nix;

struct CmdEval : MixJSON, InstallableCommand
{
    bool raw = false;

    CmdEval()
    {
        mkFlag(0, "raw", "print strings unquoted", &raw);
    }

    std::string name() override
    {
        return "eval";
    }

    std::string description() override
    {
        return "evaluate a Nix expression";
    }

    Examples examples() override
    {
        return {
            Example{
                "To evaluate a Nix expression given on the command line:",
                "nix eval '(1 + 2)'"
            },
            Example{
                "To evaluate a Nix expression from a file or URI:",
                "nix eval -f channel:nixos-17.09 hello.name"
            },
            Example{
                "To get the current version of Nixpkgs:",
                "nix eval --raw nixpkgs.lib.nixpkgsVersion"
            },
            Example{
                "To print the store path of the Hello package:",
                "nix eval --raw nixpkgs.hello"
            },
        };
    }

    void run(ref<Store> store) override<commit_msg>Update nix eval --help msg to not include deprecated command<commit_after>#include "command.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
#include "eval.hh"
#include "json.hh"
#include "value-to-json.hh"
#include "progress-bar.hh"

using namespace nix;

struct CmdEval : MixJSON, InstallableCommand
{
    bool raw = false;

    CmdEval()
    {
        mkFlag(0, "raw", "print strings unquoted", &raw);
    }

    std::string name() override
    {
        return "eval";
    }

    std::string description() override
    {
        return "evaluate a Nix expression";
    }

    Examples examples() override
    {
        return {
            Example{
                "To evaluate a Nix expression given on the command line:",
                "nix eval '(1 + 2)'"
            },
            Example{
                "To evaluate a Nix expression from a file or URI:",
                "nix eval -f channel:nixos-17.09 hello.name"
            },
            Example{
                "To get the current version of Nixpkgs:",
                "nix eval --raw nixpkgs.lib.version"
            },
            Example{
                "To print the store path of the Hello package:",
                "nix eval --raw nixpkgs.hello"
            },
        };
    }

    void run(ref<Store> store) override
{'fraction_non_alphanumeric': 0.11051419800460476, 'fraction_numerical': 0.005372217958557176, 'mean_word_length': 1.6876288659793814, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5126298', 'n_tokens_mistral': 789, 'n_tokens_neox': 738, 'n_words': 230}