diff --git a/cat.c b/cat.c index db013fe..5accecd 100644 --- a/cat.c +++ b/cat.c @@ -7,7 +7,6 @@ #include int main(int argc,char *argv[]) { - if(argc==1) { read_from_stdin(); return 0; diff --git a/meson.build b/meson.build index c52b376..d6a4b4a 100644 --- a/meson.build +++ b/meson.build @@ -1,12 +1,13 @@ -project('patricus utils', 'c', version: '3.4') +project('patricus utils', 'c', 'cpp', version: '4.0', default_options: ['cpp_std=c++20']) -# Get the short git commit hash -git_hash = run_command('git', 'rev-parse', 'HEAD', check: true).stdout().strip() +branch_name = run_command('git', 'rev-parse', '--abbrev-ref', 'HEAD', check: true).stdout().strip() +if branch_name.startswith('stable/') + full_version = meson.project_version() +else + git_hash = run_command('git', 'rev-parse', 'HEAD', check: true).stdout().strip() + full_version = '@0@(@1@)'.format(meson.project_version(), git_hash) +endif -# Combine version and hash -full_version = '@0@(@1@)'.format(meson.project_version(), git_hash) - -# Generate header conf = configuration_data() conf.set('version', '"@0@"'.format(full_version)) @@ -16,4 +17,5 @@ configure_file( ) executable('cat', ['cat.c', 'stdin.c'], include_directories: '.') -executable('cmpsize', ['cmpsize.c', 'bytes.c'], include_directories: '.') +executable('cmpsize', ['cmpsize.c', 'bytes.c']) +executable('nuke', ['nuke.cpp'], include_directories: '.') diff --git a/nuke.cpp b/nuke.cpp new file mode 100644 index 0000000..36ffa44 --- /dev/null +++ b/nuke.cpp @@ -0,0 +1,14 @@ +#include +#include +using namespace std; +int main(int argc, char* argv[]) +{ +for(int i=1;i