Sha256: 829e1e6ebcad04174ec7ce491395446e43baee40986523daf5f0c5e59671a7b1

Contents?: true

Size: 832 Bytes

Versions: 16

Compression:

Stored size: 832 Bytes

Contents

#include "lth_cat.hpp"
#include <boost/nowide/iostream.hpp>
#include <set>
namespace nw = boost::nowide;
using namespace std;

static string prompt(set<string> const& codes) {
    if (codes.count("overwhelm")) {
        return lth_cat::overwhelm;
    }
    return {};
}

int main(int argc, char** argv)
{
    // Enable special testing modes
    set<string> codes(argv+1, argv+argc);

    if (codes.count("prefix")) {
        nw::cout << lth_cat::prefix << flush;
    }

    string buf;
    nw::cout << prompt(codes) << flush;
    while (getline(nw::cin, buf)) {
        nw::cout << buf << endl;
        if (codes.count("stderr")) {
            nw::cerr << buf << endl;
        }
        nw::cout << prompt(codes) << flush;
    }

    if (codes.count("suffix")) {
        nw::cout << lth_cat::suffix << flush;
    }

    return 0;
}

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
facter-3.12.2.cfacter.20181217 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.12.1.cfacter.20181031 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.11.6.cfacter.20181031 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.12.1.cfacter.20181023 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.11.5.cfacter.20181022 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.12.0.cfacter.20181004 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.12.0.cfacter.20181001 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.12.0.cfacter.20180918 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.11.4.cfacter.20180821 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.11.3.cfacter.20180716 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.11.2.cfacter.20180612 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.9.6.cfacter.20180612 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.11.2.cfacter.20180606 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.9.6.cfacter.20180606 ext/facter/leatherman/execution/tests/lth_cat.cc
facter-3.11.0.cfacter.20180319 ext/facter/leatherman/execution/tests/lth_cat.cc
cfacter-3.11.0.rc.20180314 ext/facter/leatherman/execution/tests/lth_cat.cc