Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Rewrite Santactl Command Line Parsing to use Abseil #1305

Open
pmarkowsky opened this issue Mar 10, 2024 · 1 comment
Open

Rewrite Santactl Command Line Parsing to use Abseil #1305

pmarkowsky opened this issue Mar 10, 2024 · 1 comment

Comments

@pmarkowsky
Copy link
Contributor

There's a lot of hard to test command line parsing in santactl. This should be refactored to use Abseil's Flag library.

@russellhancox
Copy link
Contributor

I started work on this but it's going to be quite tricky and I don't believe it's possible to do without breaking invocations that currently work. The two primary issues are:

  1. The flag library is intended for a single-function binary (really, a server) but santactl is a multi-command tool with different flags for different subcommands. This has a couple of side-effects:
    a) If two commands define the same flag it causes a linker error. This can be worked around by putting those flags in a separate file with a shared header but then those flags can't have different help text.
    b) Usage/help text doesn't work properly because absl assumes all flags apply to all commands.

  2. Support for repeated flags is a little limited and works very differently to how it does currently. For example, you can use std::vector<std::string> as the flag's type and it will break the passed string on , but we have commands (e.g. fileinfo) where you can pass a flag multiple times to add more values. It's not possible to do this with absl flag, even with custom types.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants