Remove the unused debug option.

This commit is contained in:
Jonathan Naylor 2018-01-30 07:02:46 +00:00
parent 10a75649cd
commit d0caefd9d7
2 changed files with 7 additions and 20 deletions

View File

@ -31,36 +31,24 @@
int main(int argc, char** argv)
{
if (argc == 1) {
::fprintf(stderr, "Usage: P25Parrot [-d|--debug] <port>\n");
::fprintf(stderr, "Usage: P25Parrot <port>\n");
return 1;
}
int n = 1U;
bool debug = false;
bool log = true;
for (; n < argc-1; n++) {
if (::strcmp(argv[n], "-d") == 0 || ::strcmp(argv[n], "--debug") == 0) {
debug = true;
}
}
unsigned int port = ::atoi(argv[n]);
unsigned int port = ::atoi(argv[1U]);
if (port == 0U) {
::fprintf(stderr, "P25Parrot: invalid port number - %s\n", argv[n]);
::fprintf(stderr, "P25Parrot: invalid port number - %s\n", argv[1U]);
return 1;
}
CP25Parrot parrot(port, debug);
CP25Parrot parrot(port);
parrot.run();
return 0;
}
CP25Parrot::CP25Parrot(unsigned int port, bool debug) :
m_port(port),
m_debug(debug)
CP25Parrot::CP25Parrot(unsigned int port) :
m_port(port)
{
}

View File

@ -22,14 +22,13 @@
class CP25Parrot
{
public:
CP25Parrot(unsigned int port, bool debug);
CP25Parrot(unsigned int port);
~CP25Parrot();
void run();
private:
unsigned int m_port;
bool m_debug;
};
#endif