Skip to content
Snippets Groups Projects
Commit 57830006 authored by Ed Maros's avatar Ed Maros
Browse files

Merge branch '208-ldas-analysis-ready-help' into 'ldas-tools-suite-2.9.x'

Added displaying of help text for ldas_analysis_ready for -h/--help option (closes #208)

See merge request !214

(cherry picked from commit c6aee520)

f8392a28 Added displaying of help text for ldas_analysis_ready for -h/--help option (closes #208)
parent 6548a397
No related branches found
Tags filters-file-sha256-checksum-verification
1 merge request!215Merge branch '208-ldas-analysis-ready-help' into 'ldas-tools-suite-2.9.x'
Pipeline #602861 passed
# Release NEXT -
- Added displaying of help text for ldas_analysis_ready for -h/--help option (closes #208)
'
# Release 3.0.3 - December 14, 2023 # Release 3.0.3 - December 14, 2023
- Remove leading and trailing whitespaces from lines read from configuration file (closes #197) - Remove leading and trailing whitespaces from lines read from configuration file (closes #197)
......
...@@ -85,6 +85,8 @@ public: ...@@ -85,6 +85,8 @@ public:
bool SingleEntryPerLine( ) const; bool SingleEntryPerLine( ) const;
void Usage( int ExitStatus ) const;
private: private:
options_type options_visible; options_type options_visible;
char* const program_name; char* const program_name;
...@@ -96,7 +98,7 @@ private: ...@@ -96,7 +98,7 @@ private:
}; };
CommandLine::CommandLine( int ArgC, char** ArgV ) CommandLine::CommandLine( int ArgC, char** ArgV )
: program_name( ArgV[ 0 ] ), options_visible( "Allowed options" ) : options_visible( "Allowed options" ), program_name( ArgV[ 0 ] )
{ {
//------------------------------------------------------------------- //-------------------------------------------------------------------
// Options visible to help // Options visible to help
...@@ -123,8 +125,8 @@ CommandLine::CommandLine( int ArgC, char** ArgV ) ...@@ -123,8 +125,8 @@ CommandLine::CommandLine( int ArgC, char** ArgV )
boost::program_options::value< std::string >( &ifo )->default_value( boost::program_options::value< std::string >( &ifo )->default_value(
"H1" ), "H1" ),
"analysis ready channel name" ) // "analysis ready channel name" ) //
( "single-entry-per-line", ( "single-entry-per-line",
"print each entry on a separate line" ) // "print each entry on a separate line" ) //
; ;
//------------------------------------------------------------------- //-------------------------------------------------------------------
// Parse the options // Parse the options
...@@ -135,6 +137,11 @@ CommandLine::CommandLine( int ArgC, char** ArgV ) ...@@ -135,6 +137,11 @@ CommandLine::CommandLine( int ArgC, char** ArgV )
.run( ), .run( ),
options_variable_map ); options_variable_map );
boost::program_options::notify( options_variable_map ); boost::program_options::notify( options_variable_map );
if ( options_variable_map.count( "help" ) )
{
Usage( 0 );
}
} }
inline int inline int
...@@ -173,6 +180,13 @@ CommandLine::SingleEntryPerLine( ) const ...@@ -173,6 +180,13 @@ CommandLine::SingleEntryPerLine( ) const
return options_variable_map.count( "single-entry-per-line" ); return options_variable_map.count( "single-entry-per-line" );
} }
inline void
CommandLine::Usage( int ExitStatus ) const
{
std::cerr << options_visible << std::endl;
exit( ExitStatus );
}
inline void inline void
CommandLine::operator( )( ) CommandLine::operator( )( )
{ {
...@@ -369,7 +383,6 @@ find_analysis_ready_intervals( ...@@ -369,7 +383,6 @@ find_analysis_ready_intervals(
FrameCPP::FrTOC const* toc = FrameCPP::FrTOC const* toc =
dynamic_cast< FrameCPP::FrTOC const* >( frame_stream.GetTOC( ) ); dynamic_cast< FrameCPP::FrTOC const* >( frame_stream.GetTOC( ) );
std::ostringstream channel_name; std::ostringstream channel_name;
INT_4U gps_start_time_of_frame;
channel_name << Options.IFO( ) << ":" channel_name << Options.IFO( ) << ":"
<< Options.AnalysisReadyChannelName( ); << Options.AnalysisReadyChannelName( );
...@@ -411,7 +424,6 @@ find_analysis_ready_intervals( ...@@ -411,7 +424,6 @@ find_analysis_ready_intervals(
int int
main( int ArgC, char** ArgV ) main( int ArgC, char** ArgV )
{ {
static const char* caller = "main";
MemChecker::Trigger gc_trigger( true ); MemChecker::Trigger gc_trigger( true );
static FrameAPI::interval_container_type analysis_ready; static FrameAPI::interval_container_type analysis_ready;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment