| 856 | #endif |
| 857 | |
| 858 | int main(int argc, char *argv[]) |
| 859 | { |
| 860 | LasTool_lasdiff lastool; |
| 861 | lastool.init(argc, argv, "lasdiff"); |
| 862 | int i; |
| 863 | int random_seeks = 0; |
| 864 | const CHAR* wildcard1 = 0; |
| 865 | const CHAR* wildcard2 = 0; |
| 866 | double start_time = 0.0; |
| 867 | |
| 868 | LASreadOpener lasreadopener; |
| 869 | LASwriteOpener laswriteopener; |
| 870 | |
| 871 | if (argc == 1) |
| 872 | { |
| 873 | #ifdef COMPILE_WITH_GUI |
| 874 | return lasdiff_gui(argc, argv, 0); |
| 875 | #else |
| 876 | wait_on_exit(); |
| 877 | char file_name[256]; |
| 878 | fprintf(stderr,"%s is better run in the command line\n", argv[0]); |
| 879 | fprintf(stderr,"enter input file1: "); fgets(file_name, 256, stdin); |
| 880 | file_name[strlen(file_name)-1] = '\0'; |
| 881 | lasreadopener.set_file_name(file_name); |
| 882 | fprintf(stderr,"enter input file2: "); fgets(file_name, 256, stdin); |
| 883 | file_name[strlen(file_name)-1] = '\0'; |
| 884 | lasreadopener.set_file_name(file_name); |
| 885 | #endif |
| 886 | } |
| 887 | else |
| 888 | { |
| 889 | for (i = 1; i < argc; i++) |
| 890 | { |
| 891 | if ((unsigned char)argv[i][0] == 0x96) argv[i][0] = '-'; |
| 892 | } |
| 893 | lasreadopener.parse(argc, argv); |
| 894 | laswriteopener.parse(argc, argv); |
| 895 | } |
| 896 | |
| 897 | auto arg_local = [&](int& i) -> bool { |
| 898 | if (strcmp(argv[i],"-random_seeks") == 0) |
| 899 | { |
| 900 | random_seeks = 10; |
| 901 | } |
| 902 | else if (strcmp(argv[i],"-wildcards") == 0) |
| 903 | { |
| 904 | if ((i+2) >= argc) |
| 905 | { |
| 906 | laserror("'%s' needs 2 arguments: wildcard1 wildcard2", argv[i]); |
| 907 | } |
| 908 | wildcard1 = argv[i+1]; |
| 909 | wildcard2 = argv[i+2]; |
| 910 | i+=2; |
| 911 | } |
| 912 | else if (strcmp(argv[i],"-shutup") == 0) |
| 913 | { |
| 914 | i++; |
| 915 | shutup = atoi(argv[i]);; |
nothing calls this directly
no test coverage detected