uhd-urz / elAPI

An extensible API client for eLabFTW
GNU Affero General Public License v3.0
5 stars 0 forks source link

Change YAML extension convention from .yaml to .yml - [merged] #70

Closed alexander-haller closed 4 months ago

alexander-haller commented 11 months ago

In GitLab by @mhxion on Nov 29, 2023, 23:06

Merges change-YAML-config-extension-name -> main

This PR adds necessary changes that make the switch from .yaml to .yml possible with elegance! Though the effect of the change is straightforward, I still wanted to highlight the main behavioral changes to give you a chance to review.

  1. elAPI will only recognize elapi.yml as its configuration file name in all three search locations (/etc, $HOME/.config, .).
  2. For commands like bill-teams and get, if YAML is passed to --format/-F to define the export data format, the exported data will have .yml extension.
    $ elapi bill-teams info -F yml --export
                           ^^^
    # or
    $ elapi bill-teams info -F yaml --export
                           ^^^^
    # In both cases, data will be exported to "datetime_bill_teams.yml" file to maintain the .yml convention.
                                                               ^^^
  3. However, if a full file path is given, then the file name provided will be honored.
    
    $ elapi bill-teams info --export ~/bill_teams_info.yaml
                                                   ^^^^

Exports to "bill_teams_info.yaml" file (".yaml" remains unchanged).

alexander-haller commented 11 months ago

In GitLab by @mhxion on Nov 29, 2023, 23:06

requested review from @alexander-haller

alexander-haller commented 11 months ago

approved this merge request