Compare commits
1 commit
main
...
stable/3.4
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7428365f06 |
4 changed files with 6 additions and 34 deletions
2
cat.c
2
cat.c
|
@ -13,7 +13,7 @@ return 0;
|
|||
}
|
||||
if(strcmp(argv[1],"-v")==0)
|
||||
{
|
||||
printf("patricus utils, version %s",VERSION);
|
||||
printf("patricus utils, version %s",version);
|
||||
return 0;
|
||||
}
|
||||
for(int meowing=1;meowing<argc;meowing++){
|
||||
|
|
|
@ -11,7 +11,7 @@ int main(int argc, char *argv[]) {
|
|||
return 1;
|
||||
}
|
||||
else if(strcmp("-v", argv[1]) == 0) {
|
||||
printf("patricus utils, version %s", VERSION);
|
||||
printf("patricus utils, version %s", version);
|
||||
return 0;
|
||||
}
|
||||
else if(argc == 2) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
project('patricus utils', 'c', 'cpp', version: '4.0', default_options: ['cpp_std=c++20'])
|
||||
|
||||
project('patricus utils', 'c', version: '3.4')
|
||||
branch_name = run_command('git', 'rev-parse', '--abbrev-ref', 'HEAD', check: true).stdout().strip()
|
||||
if branch_name.startswith('stable/')
|
||||
full_version = meson.project_version()
|
||||
|
@ -8,8 +7,9 @@ else
|
|||
full_version = '@0@(@1@)'.format(meson.project_version(), git_hash)
|
||||
endif
|
||||
|
||||
# Generate header
|
||||
conf = configuration_data()
|
||||
conf.set('VERSION', '"@0@"'.format(full_version))
|
||||
conf.set('version', '"@0@"'.format(full_version))
|
||||
|
||||
configure_file(
|
||||
output: 'version.h',
|
||||
|
@ -17,5 +17,4 @@ configure_file(
|
|||
)
|
||||
|
||||
executable('cat', ['cat.c', 'stdin.c'], include_directories: '.')
|
||||
executable('cmpsize', ['cmpsize.c', 'bytes.c'])
|
||||
executable('nuke', ['nuke.cpp'], include_directories: '.')
|
||||
executable('cmpsize', ['cmpsize.c', 'bytes.c'], include_directories: '.')
|
||||
|
|
27
nuke.cpp
27
nuke.cpp
|
@ -1,27 +0,0 @@
|
|||
#include<version.h>
|
||||
#include<string>
|
||||
#include<filesystem>
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
for(int i=1;i<argc;i++){
|
||||
if (string(argv[i]) == "-v")
|
||||
{
|
||||
cout<<"patricus utils, version "+string(VERSION);
|
||||
return 0;
|
||||
}
|
||||
if(!filesystem::exists(argv[i]))
|
||||
{
|
||||
cerr<<"error, no such file or directory";
|
||||
return 1;
|
||||
}
|
||||
try
|
||||
{
|
||||
filesystem::remove_all(argv[i]);
|
||||
}
|
||||
catch(std::filesystem::filesystem_error){
|
||||
cout<<"error: permission denied";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue