Skip to content

Commit

Permalink
apps: improve command line parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
lars18th committed Feb 1, 2018
1 parent 3314544 commit cfd08bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions apps/srt-file-transmit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ int main( int argc, char** argv )
o_buffer = {"b", "buffer" },
o_verbose = {"v", "verbose" },
o_noflush = {"s", "skipflush" },
o_fullstats = {"f", "full-stats" };
o_fullstats = {"f", "fullstats" };

// Options that expect no arguments (ARG_NONE) need not be mentioned.
vector<OptionScheme> optargs = {
{ o_loglevel, OptionScheme::ARG_ONE },
{ o_buffer, OptionScheme::ARG_ONE }
{ o_buffer, OptionScheme::ARG_ONE },
{ o_noflush, OptionScheme::ARG_NONE },
{ o_fullstats, OptionScheme::ARG_NONE }
};
options_t params = ProcessOptions(argv, argc, optargs);

Expand Down
6 changes: 4 additions & 2 deletions apps/srt-live-transmit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,15 @@ int main( int argc, char** argv )
{
cerr << "Usage: " << argv[0] << " [options] <input-uri> <output-uri>\n";
cerr << "\t-t:<timeout=0> - connection timeout\n";
cerr << "\t-d:<stoptime=0> - connection stop time\n";
cerr << "\t-c:<chunk=1316> - max size of data read in one step\n";
cerr << "\t-b:<bandwidth> - set SRT bandwidth\n";
cerr << "\t-r:<report-frequency=0> - bandwidth report frequency\n";
cerr << "\t-s:<stats-report-freq=0> - frequency of status report\n";
cerr << "\t-f - full counters in stats-report (prints total statistics)\n";
cerr << "\t-S - skip flushing\n";
cerr << "\t-k - crash on error (aka developer mode)\n";
cerr << "\t-v - verbose mode (prints also size of every data packet passed)\n";
cerr << "\t-f - full counters (prints total statistics without reset)\n";
return 1;
}

Expand All @@ -275,7 +277,7 @@ int main( int argc, char** argv )
string logfile = Option("", "logfile");
bool internal_log = Option("no", "loginternal") != "no";
bool skip_flushing = Option("no", "S", "skipflush") != "no";
transmit_total_stats = Option("no", "f", "full-stats") != "no";
transmit_total_stats = Option("no", "f", "fullstats") != "no";

// Options that require integer conversion
unsigned long bandwidth;
Expand Down

0 comments on commit cfd08bc

Please sign in to comment.