Change in osmo-trx[master]: Add long parameters (--help, --version, ...)

2018-10-23 Thread osmith
osmith has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11435 )

Change subject: Add long parameters (--help, --version, ...)
..

Add long parameters (--help, --version, ...)

Makes osmo-trx-* more consistent with other Osmocom programs, and
allows an unified test for not having "UNKNOWN" in --version.

Related: OS#3578
Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
---
M Transceiver52M/osmo-trx.cpp
1 file changed, 12 insertions(+), 4 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  osmith: Verified



diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 7f72c47..b6b676e 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -211,9 +212,9 @@
 static void print_help()
 {
fprintf(stdout, "Options:\n"
-   "  -hThis text\n"
-   "  -CFilename The config file to use\n"
-   "  -VPrint the version of OsmoTRX\n"
+   "  -h, --help  This text\n"
+   "  -C, --configFilename The config file to use\n"
+   "  -V, --version   Print the version of OsmoTRX\n"
);
 }

@@ -230,8 +231,15 @@
unsigned int i;
std::vector rx_paths, tx_paths;
bool rx_paths_set = false, tx_paths_set = false;
+   static struct option long_options[] = {
+   {"help", 0, 0, 'h'},
+   {"config", 1, 0, 'C'},
+   {"version", 0, 0, 'V'},
+   {NULL, 0, 0, 0}
+   };

-   while ((option = getopt(argc, argv, 
"ha:l:i:j:p:c:dmxgfo:s:b:r:A:R:Set:y:z:C:V")) != -1) {
+   while ((option = getopt_long(argc, argv, 
"ha:l:i:j:p:c:dmxgfo:s:b:r:A:R:Set:y:z:C:V", long_options,
+   NULL)) != -1) {
switch (option) {
case 'h':
print_help();

--
To view, visit https://gerrit.osmocom.org/11435
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
Gerrit-Change-Number: 11435
Gerrit-PatchSet: 3
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 


Change in osmo-trx[master]: Add long parameters (--help, --version, ...)

2018-10-23 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/11435 )

Change subject: Add long parameters (--help, --version, ...)
..


Patch Set 2: Verified+1


--
To view, visit https://gerrit.osmocom.org/11435
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
Gerrit-Change-Number: 11435
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 23 Oct 2018 11:34:41 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: Add long parameters (--help, --version, ...)

2018-10-23 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11435 )

Change subject: Add long parameters (--help, --version, ...)
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11435
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
Gerrit-Change-Number: 11435
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 23 Oct 2018 11:34:29 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: Add long parameters (--help, --version, ...)

2018-10-23 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/11435 )

Change subject: Add long parameters (--help, --version, ...)
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/11435/1/Transceiver52M/osmo-trx.cpp
File Transceiver52M/osmo-trx.cpp:

https://gerrit.osmocom.org/#/c/11435/1/Transceiver52M/osmo-trx.cpp@236
PS1, Line 236:  {"config-file", 1, 0, 'C'},
> why config above and config-file here?
Copy paste mistake from osmo-sip-connector. Fixed now, thanks!



--
To view, visit https://gerrit.osmocom.org/11435
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
Gerrit-Change-Number: 11435
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 23 Oct 2018 11:33:25 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: Add long parameters (--help, --version, ...)

2018-10-23 Thread osmith
Hello Pau Espin Pedrol, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11435

to look at the new patch set (#2).

Change subject: Add long parameters (--help, --version, ...)
..

Add long parameters (--help, --version, ...)

Makes osmo-trx-* more consistent with other Osmocom programs, and
allows an unified test for not having "UNKNOWN" in --version.

Related: OS#3578
Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
---
M Transceiver52M/osmo-trx.cpp
1 file changed, 12 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/35/11435/2
--
To view, visit https://gerrit.osmocom.org/11435
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
Gerrit-Change-Number: 11435
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-trx[master]: Add long parameters (--help, --version, ...)

2018-10-23 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11435 )

Change subject: Add long parameters (--help, --version, ...)
..


Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/11435/1/Transceiver52M/osmo-trx.cpp
File Transceiver52M/osmo-trx.cpp:

https://gerrit.osmocom.org/#/c/11435/1/Transceiver52M/osmo-trx.cpp@236
PS1, Line 236:  {"config-file", 1, 0, 'C'},
why config above and config-file here?



--
To view, visit https://gerrit.osmocom.org/11435
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
Gerrit-Change-Number: 11435
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 23 Oct 2018 11:28:35 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: Add long parameters (--help, --version, ...)

2018-10-23 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11435 )

Change subject: Add long parameters (--help, --version, ...)
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11435
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
Gerrit-Change-Number: 11435
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 23 Oct 2018 11:27:59 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: Add long parameters (--help, --version, ...)

2018-10-23 Thread osmith
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/11435


Change subject: Add long parameters (--help, --version, ...)
..

Add long parameters (--help, --version, ...)

Makes osmo-trx-* more consistent with other Osmocom programs, and
allows an unified test for not having "UNKNOWN" in --version.

Related: OS#3578
Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
---
M Transceiver52M/osmo-trx.cpp
1 file changed, 12 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/35/11435/1

diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index d01a4cf..1caa225 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -211,9 +212,9 @@
 static void print_help()
 {
fprintf(stdout, "Options:\n"
-   "  -hThis text\n"
-   "  -CFilename The config file to use\n"
-   "  -VPrint the version of OsmoTRX\n"
+   "  -h, --help  This text\n"
+   "  -C, --configFilename The config file to use\n"
+   "  -V, --version   Print the version of OsmoTRX\n"
);
 }

@@ -230,8 +231,15 @@
unsigned int i;
std::vector rx_paths, tx_paths;
bool rx_paths_set = false, tx_paths_set = false;
+   static struct option long_options[] = {
+   {"help", 0, 0, 'h'},
+   {"config-file", 1, 0, 'C'},
+   {"version", 0, 0, 'V' },
+   {NULL, 0, 0, 0}
+   };

-   while ((option = getopt(argc, argv, 
"ha:l:i:j:p:c:dmxgfo:s:b:r:A:R:Set:y:z:C:V")) != -1) {
+   while ((option = getopt_long(argc, argv, 
"ha:l:i:j:p:c:dmxgfo:s:b:r:A:R:Set:y:z:C:V", long_options,
+   NULL)) != -1) {
switch (option) {
case 'h':
print_help();

--
To view, visit https://gerrit.osmocom.org/11435
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
Gerrit-Change-Number: 11435
Gerrit-PatchSet: 1
Gerrit-Owner: osmith