Skip to content
Snippets Groups Projects
Verified Commit 5ed29d22 authored by Thibault Payet's avatar Thibault Payet
Browse files

Add an option to just convert a txt with same output name

parent 951bf8c1
Branches
No related tags found
No related merge requests found
......@@ -104,7 +104,7 @@ void txt2pcd( std::filesystem::path input, std::filesystem::path output )
void printHelp()
{
std::cout << "Usage: txt2pcd inputCloud.txt outputCloud.pcd\n";
std::cout << "Usage: txt2pcd inputCloud.txt [outputCloud.pcd]\n";
}
int main( int argc, char** argv )
......@@ -120,6 +120,14 @@ int main( int argc, char** argv )
std::cerr << e.what() << "\n";
}
}
else if ( argc == 2 )
{
auto basefilename = std::filesystem::path{ argv[ 1 ] };
auto outfilename = basefilename;
outfilename.replace_extension( std::filesystem::path{ "pcd" } );
txt2pcd( basefilename, outfilename );
}
else
{
printHelp();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment