glpi-project / glpi-agent

GLPI Agent
GNU General Public License v2.0
240 stars 60 forks source link

glpi-injector duplicate option #537

Closed po1vo closed 10 months ago

po1vo commented 10 months ago

Bug reporting acknowledgment

Yes, I read it

Professional support

None

Describe the bug

Note the same -x option

    -x --xml-ua    use Client version found in XML as User-Agent for POST
    -x --json-ua   use Client version found in JSON as User-Agent for POST

To reproduce

glpi-injector -h

Expected behavior

GetOptions(

    'xml-ua|x',
    'json-ua',

);

Operating system

Linux

GLPI Agent version

1.6.1

GLPI version

10.0.10

GLPIInventory plugin or FusionInventory for GLPI plugin version

GLPI Inventory v1.3.3

Additional context

No response

g-bougard commented 10 months ago

Hi @po1vo

I agree this was not clear. I tried to add --json-ua to work like --xml-ua but for JSON format to be sure to not break scripts using it after the inventory format becomes JSON. Now I modified the code so -x, --xml-ua or --json-ua are fully equivalent. Before, if you used --json-ua, this didn't trigger the UA extraction from an XML. Now it does as options are equivalent. And than you'll don't see duplicated options.