Skip to content

daemons: changing our custom daemon CLI parsing with CLI11#1187

Merged
joergsteffens merged 26 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/CLI11-daemon-cli-parsing
Jul 11, 2022
Merged

daemons: changing our custom daemon CLI parsing with CLI11#1187
joergsteffens merged 26 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/CLI11-daemon-cli-parsing

Conversation

@alaaeddineelamri
Copy link
Contributor

@alaaeddineelamri alaaeddineelamri commented Jun 7, 2022

Description

This PR aims to standardize daemon argument parsing using a third party library called CLI11.
Documentation can be found here and also here.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

General
  • PR name is meaningful
  • Purpose of the PR is understood
  • Separate commit for this PR in the CHANGELOG.md, PR number referenced is same
  • Commit descriptions are understandable and well formatted
  • [ ] If backport: add original PR number and target branch at top of this file: Backport of PR#000 to bareos-2x
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
  • bareos-check-sources --since-merge does not report any problems
  • git status should not report modifications in the source tree after building and testing
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/CLI11-daemon-cli-parsing branch 2 times, most recently from c3bbf9b to ce660b8 Compare June 13, 2022 13:03
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/CLI11-daemon-cli-parsing branch 11 times, most recently from 131815b to 6ebf335 Compare June 21, 2022 11:33
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/CLI11-daemon-cli-parsing branch from 6ebf335 to b71c9d6 Compare June 22, 2022 08:55
@alaaeddineelamri alaaeddineelamri changed the title Daemon CLI parsing [WIP] daemons: changing our custom daemon CLI parsing with CLI11 Jun 22, 2022
@alaaeddineelamri alaaeddineelamri marked this pull request as ready for review June 22, 2022 09:04
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/CLI11-daemon-cli-parsing branch 6 times, most recently from 227de93 to 80d62ac Compare June 23, 2022 17:06
@joergsteffens joergsteffens self-requested a review June 23, 2022 17:36
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/CLI11-daemon-cli-parsing branch 2 times, most recently from 905de13 to fbe7427 Compare June 27, 2022 19:15
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/CLI11-daemon-cli-parsing branch from fbe7427 to 764009c Compare June 28, 2022 12:48
Copy link
Member

@joergsteffens joergsteffens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not through all files, howver wanted to provide you the part of the review already done.

@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/CLI11-daemon-cli-parsing branch from 764009c to b2e506f Compare June 30, 2022 10:57
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/CLI11-daemon-cli-parsing branch from 9a3183d to ce85b24 Compare July 8, 2022 11:33
@joergsteffens joergsteffens self-requested a review July 11, 2022 08:25
Alaa Eddine Elamri and others added 24 commits July 11, 2022 10:32
added readme
ignore third-party in bareos-check-sources
Macros `P(x)` and `V(x)` create conflicts with CLI11.
We decided to remove the macro all together and rename the 
function to be more expressive.

Anecdote: 
V stands for 'Verhoog', which can be translated as "increment" from dutch.
P stands for 'Prolaag', a madeup Dutch word of 'probeer verlaag',
which can be translated as "try to decrease".

These words were coined by Edsger W. Dijkstra.
the initial reason for attracting attention, was that it made the build fail 
on certain conditions.
updated documentation
gtest: add test for CLI help formatting
... and use them in the documentation.

As before, some commands are only executed when docs-build-json is set.
We now handle this by an if clause.
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/CLI11-daemon-cli-parsing branch from ce85b24 to 9a5bfca Compare July 11, 2022 08:34
Copy link
Member

@joergsteffens joergsteffens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@joergsteffens joergsteffens merged commit 009f9dd into bareos:master Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants