xmlsquad / gsheet-to-xml

Given the url of a Google Sheet, this Symfony Console command fetches the Google Sheet and outputs it in the form of Xml.
Apache License 2.0
2 stars 1 forks source link

Documentation Usage Example needs altering. #12

Open forikal-uk opened 6 years ago

forikal-uk commented 6 years ago

Steps to recreate

See my notes as I follow the Usage example in the docs.

What occurs

I invoke the command using the format to grab a sample sheet suggested by the docs:

$ pwd
/Users/x/Documents/Projects/XmlAuthoring/gsheet-to-xml

$ php bin/gsheet-to-xml.php forikal:gsheet-to-xml https://docs.google.com/spreadsheets/d/1_SnGKyXjHnsdylZw_YYIQ8HuxYQI-hsvxYQpftGMjpM/edit#gid=311423522 --credentials=../../../../APIKeys/gsheet-to-xml-e5eaf708560f.json

  Too many arguments, expected arguments "drive-url".  

forikal:gsheet-to-xml [-c|--credentials [CREDENTIALS]] [--] <drive-url>

I get an error.

What is expected

The docs should be updated to explain the example command syntax is only when the command is run in the context of a console suite of commands.

and if run as a standalone command then it should look something like this:

try without the command name.

$ php bin/gsheet-to-xml.php  --credentials="../../../../APIKeys/gsheet-to-xml-e5eaf708560f.json" https://docs.google.com/spreadsheets/d/1_SnGKyXjHnsdylZw_YYIQ8HuxYQI-hsvxYQpftGMjpM/edit#gid=311423522
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Products>
  <Product>
    <Inventory src-sheet="DocumentationSampleSheet" src-sheet-url="https://docs.google.com/spreadsheets/d/1_SnGKyXjHnsdylZw_YYIQ8HuxYQI-hsvxYQpftGMjpM/edit#gid=311423522" src-tab="InventoryTab">
      <StockItem>
        <KNumberExists>true</KNumberExists>
        <KNumber>1111111</KNumber>
        <AdditionalKNumbers></AdditionalKNumbers>
        <AlternativeNumber></AlternativeNumber>
        <InventoryContainerID></InventoryContainerID>
        <Name>baz</Name>
        <Purposes>
          <Purpose>11</Purpose>
        </Purposes>
        <PurposeOther></PurposeOther>
        <InventoryQuantity>99</InventoryQuantity>
        <HandlingStatus></HandlingStatus>
        <SupplierRegistrationNumber></SupplierRegistrationNumber>
      </StockItem>
      <StockItem>
        <KNumberExists>false</KNumberExists>
        <KNumber></KNumber>
        <AdditionalKNumbers></AdditionalKNumbers>
        <AlternativeNumber>foo</AlternativeNumber>
        <InventoryContainerID></InventoryContainerID>
        <Name>bar</Name>
        <Purposes>
          <Purpose>2</Purpose>
        </Purposes>
        <PurposeOther></PurposeOther>
        <InventoryQuantity>99</InventoryQuantity>
        <HandlingStatus></HandlingStatus>
        <SupplierRegistrationNumber></SupplierRegistrationNumber>
      </StockItem>
    </Inventory>
  </Product>
</Products>

Notes

I guess all the commands are slowly getting a more consistent interface.