Open KannarFr opened 7 months ago
@KannarFr I'm not sure we ever used repeated options in the CLI, can you check in the existing commands? I guess it would be a nice way to provide the option.
@miton18 @davlgd @aurrelhebert WDYT?
I think it's a behavior expected from an API an in cURL requests, but not from CLI flags (even if you can repeat some parameters in tools such as git
for example, but I see this more as the exception than the main rule). IMHO, it could be interesting to discuss about the good way to implement this in Clever Tools.
IMHO, it could be interesting to discuss about the good way to implement this in Clever Tools.
This is the goal here. Then I suggest clever logs -s|--services bas,cronie,run-*
(it supports regex).
I think it's a behavior expected from an API an in cURL requests, but not from CLI flags (even if you can repeat some parameters in tools such as git for example, but I see this more as the exception than the main rule). IMHO, it could be interesting to discuss about the good way to implement this in Clever Tools.
Docker does this with env vars, volumes and port mapping. I think people are used to that.
This is the goal here. Then I suggest clever logs -s|--services bas,cronie,run-* (it supports regex).
Coma separated value is fine by me but when you say supports regex, you mean we give bas,cronie,run-*
directly to the API?
(FYI run-*
is not a regex :stuck_out_tongue:)
Let's say we only support regex on the API side, not exposing just "internal" stuff for default retuned services because systemd-timers services names are generated on run.
run-*
is a valid regex but not the one I expected, is ^run\-*
better?
Same as @hsablonniere to start with Coma separated value is fine by me
and to support an all keyword. For regexp
if we only have 5 to 6 items, it seems to me to be overkill. However if it supported on the API side, there are no issues for me to support it too on the CLI (without adding any validation on the regexp).
API is not supporting it. It's only used "internally" for default services when no service
query strings are passed.
From API side, 'service' query parameter supports
'bas', 'bas-deploy', '^run\\-*', "cronie" if no value is set
a list of regex (Ex: ?service=bas&service=^run\\-*)
the special keyword '?service=all'
Logs v4 provides the flexibility to specify logged services, offering a default set that includes (
bas
,bas-deploy
,cronie
,run-*
). It also supports theall
keyword.I intend to incorporate the usage of these options into
clever logs
. However, I am unsure about the preferred format. Should it be implemented as a repeated option like-s
--service
--services
, or perhaps as a list of services passed to a non-repeatable option? I welcome your guidance on this matter.