From 2e4a2916d9bc8cc5ea6fdca4e04efb32422d6c6d Mon Sep 17 00:00:00 2001 From: Panagiotis Cheilaris Date: Mon, 30 Jul 2012 22:48:25 +0300 Subject: [PATCH] sdg-filtered-traits.cpp: command line argument --- .../Segment_Delaunay_graph_Linf_2/sdg-filtered-traits.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/Segment_Delaunay_graph_Linf_2/sdg-filtered-traits.cpp b/examples/Segment_Delaunay_graph_Linf_2/sdg-filtered-traits.cpp index 4552a39943e..4fa7c8d9d97 100644 --- a/examples/Segment_Delaunay_graph_Linf_2/sdg-filtered-traits.cpp +++ b/examples/Segment_Delaunay_graph_Linf_2/sdg-filtered-traits.cpp @@ -21,9 +21,13 @@ struct Gt typedef CGAL::Segment_Delaunay_graph_Linf_hierarchy_2 SDG2; -int main() +int main( int argc, char *argv[] ) { - std::ifstream ifs("data/sites.cin"); + if ( not (( argc == 1 ) or (argc == 2)) ) { + std::cout <<"usage: "<< argv[0] <<" [filename]\n"; + } + + std::ifstream ifs( (argc == 1) ? "data/sites.cin" : argv[1] ); assert( ifs ); SDG2 sdg;