diff --git a/meson.build b/meson.build index 922f48f..6572cbc 100644 --- a/meson.build +++ b/meson.build @@ -1,19 +1,23 @@ project('ppgen', ['cpp'], - version: '1.1', - license: 'GPL3+', + version: '1.2', + license: 'GPL3+', default_options : ['cpp_std=c++14', - 'buildtype=release']) + 'buildtype=release']) + +if not meson.get_compiler('cpp').has_header_symbol('experimental/iterator', '__cpp_lib_experimental_ostream_joiner') + error('C++ ostream_joiner not available. Use release 1.1') +endif pcg_cpp_sp = subproject('pcg-cpp') pcg_cpp_dep = pcg_cpp_sp.get_variable('pcg_cpp_dep') -ppgen = executable('ppgen', join_paths('src', 'ppgen.cpp'), - dependencies: pcg_cpp_dep, - install: true) +ppgen = executable('ppgen', 'src/ppgen.cpp', + dependencies: pcg_cpp_dep, + install: true) -pingen = executable('pingen', join_paths('src', 'pingen.cpp'), - dependencies: pcg_cpp_dep, - install: true) +pingen = executable('pingen', 'src/pingen.cpp', + dependencies: pcg_cpp_dep, + install: true) -install_man(join_paths('man', 'ppgen.1')) -install_man(join_paths('man', 'pingen.1')) +install_man('man/ppgen.1') +install_man('man/pingen.1') diff --git a/src/ppgen.cpp b/src/ppgen.cpp index 57af434..2ee7c25 100644 --- a/src/ppgen.cpp +++ b/src/ppgen.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include "pcg_random.hpp" #include "diceware_wordlist.h" #include "eff_wordlist.h" @@ -53,8 +54,9 @@ int main(int argc, char** arg_begin) std::cout << "Choose from one of these 10 passphrases:\n\n"; for (int gen_num = 0; gen_num < 10; ++gen_num) { + auto out = std::experimental::make_ostream_joiner(std::cout, " "); for (long word = 0; word < num_words; ++word) { - std::cout << wordlist[dis(rng)] << " "; + out = wordlist[dis(rng)]; } std::cout << std::endl; }