MCPcopy Create free account
hub / github.com/LAStools/LAStools / main

Function main

src/lasdiff.cpp:858–1143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

856#endif
857
858int 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]);;

Callers

nothing calls this directly

Calls 15

laserrorFunction · 0.85
LASMessageFunction · 0.85
check_headerFunction · 0.85
check_pointsFunction · 0.85
get_file_name_numberMethod · 0.80
get_directoryMethod · 0.80
get_appendixMethod · 0.80
make_file_nameMethod · 0.80
taketimeFunction · 0.70
byebyeFunction · 0.50
initMethod · 0.45
set_file_nameMethod · 0.45

Tested by

no test coverage detected