mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
status code 0 means success, non-zero failure
This commit is contained in:
parent
0a1b879a42
commit
45d9844f80
@ -29,7 +29,7 @@ int
|
|||||||
main(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
cerr << "Usage: apply_patch <patch> <file>" << endl;
|
cerr << "Usage: apply_patch <patch> <file>" << endl;
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Filename patch = argv[1];
|
Filename patch = argv[1];
|
||||||
@ -41,8 +41,10 @@ main(int argc, char *argv[]) {
|
|||||||
Patchfile pfile;
|
Patchfile pfile;
|
||||||
|
|
||||||
cerr << "Applying patch file " << patch << " to " << file << endl;
|
cerr << "Applying patch file " << patch << " to " << file << endl;
|
||||||
if (pfile.apply(patch, file) == false)
|
if (pfile.apply(patch, file) == false) {
|
||||||
cerr << "apply patch failed" << endl;
|
cerr << "apply patch failed" << endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ int
|
|||||||
main(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
cerr << "Usage: build_patch <src_file> <dest_file>" << endl;
|
cerr << "Usage: build_patch <src_file> <dest_file>" << endl;
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Filename src_file = argv[1];
|
Filename src_file = argv[1];
|
||||||
@ -42,8 +42,10 @@ main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
cerr << "Building patch file to convert " << src_file << " to "
|
cerr << "Building patch file to convert " << src_file << " to "
|
||||||
<< dest_file << endl;
|
<< dest_file << endl;
|
||||||
if (pfile.build(src_file, dest_file) == false)
|
if (pfile.build(src_file, dest_file) == false) {
|
||||||
cerr << "build patch failed" << endl;
|
cerr << "build patch failed" << endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -22,12 +22,12 @@ int
|
|||||||
main(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
cerr << "Usage: check_adler <file>" << endl;
|
cerr << "Usage: check_adler <file>" << endl;
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Filename source_file = argv[1];
|
Filename source_file = argv[1];
|
||||||
|
|
||||||
cout << check_adler(source_file);
|
cout << check_adler(source_file);
|
||||||
|
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -22,12 +22,12 @@ int
|
|||||||
main(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
cerr << "Usage: check_crc <file>" << endl;
|
cerr << "Usage: check_crc <file>" << endl;
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Filename source_file = argv[1];
|
Filename source_file = argv[1];
|
||||||
|
|
||||||
cout << check_crc(source_file);
|
cout << check_crc(source_file);
|
||||||
|
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ main(int argc, char *argv[]) {
|
|||||||
const char *usagestr="Usage: check_md5 [-dbfmt_output] <file>";
|
const char *usagestr="Usage: check_md5 [-dbfmt_output] <file>";
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
cerr << usagestr << endl;
|
cerr << usagestr << endl;
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bRemoveBrackets = (strcmp("-dbfmt_output",argv[1])==0);
|
bool bRemoveBrackets = (strcmp("-dbfmt_output",argv[1])==0);
|
||||||
@ -36,7 +36,7 @@ main(int argc, char *argv[]) {
|
|||||||
if(bRemoveBrackets) {
|
if(bRemoveBrackets) {
|
||||||
if(argc<3) {
|
if(argc<3) {
|
||||||
cerr << usagestr << endl;
|
cerr << usagestr << endl;
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
source_file = Filename::from_os_specific(argv[2]);
|
source_file = Filename::from_os_specific(argv[2]);
|
||||||
} else {
|
} else {
|
||||||
@ -46,7 +46,7 @@ main(int argc, char *argv[]) {
|
|||||||
if(!source_file.exists()) {
|
if(!source_file.exists()) {
|
||||||
cerr << usagestr << endl;
|
cerr << usagestr << endl;
|
||||||
cerr << source_file << " not found!\n";
|
cerr << source_file << " not found!\n";
|
||||||
return -1;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
HashVal hash;
|
HashVal hash;
|
||||||
@ -60,5 +60,5 @@ main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
cout << hash << endl;
|
cout << hash << endl;
|
||||||
|
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user