Hi everyone,
First of all, thanks a lot for all the work that you've put in this great library. I discovered picocli only recently and I'm impressed about the capabilities and the simplicity of use! Especially in combination with native-image this is surely a game-changer to build great cli applications!
I have a specific use-case that I wanted to discuss.
Use-Case
I'm running my cli application in docker and there is a REST facade to create new containers with specific parameters. All parameters can also be set via env-variables which fits perfectly because I can just create a docker env-file where I specify all parameters that then get injected to the java fields with picocli.
However there is a limitation with env-files: They don't support multi-line values and I have some parameters that might contain multiple values (e.g. a String template that is used by the application). Of course I could use files here that I would link inside the container but I want to keep it simple (e.g. because I'm not sure if I want to migrate in future e.g. to another container runtime or to K8s).
My idea would be to encode such values with Base64, put them in the docker env files and then decode them again inside the application.
How to handle it properly with picocli?
If I wanted to just handover all values in Base64 format and then decode them before they are injected with picocli, how would be the right approach for this?
I've seen in the documentation that I could use IParameterConsumer (simple) or IParameterPreprocessor (more flexible). I tested this for example with a boolean field and I've seen that it works if I do it like this:
boolean field:
```
@Option(names = "--test-flag", defaultValue = "dHJ1ZQ==" /* base64-encoded 'true' */, parameterConsumer = Base64BooleanConsumer.class)
private boolean testFlag;
```
Consumer class:
```
@Override
public void consumeParameters(final Stack<String> args, final CommandLine.Model.ArgSpec argSpec, final CommandLine.Model.CommandSpec commandSpec)
{
if (!args.isEmpty())
{
String result = new String(Base64.getDecoder().decode(args.pop()));
argSpec.setValue(Boolean.parseBoolean(result));
}
}
```
However I see 2 issues here:
* #1: I need to have type-specific Consumer-classes. Would I would like to have would be a consumer that just decodes the String and then hands it over to picocli for type detection. Is this possible somehow?
* #2: the default-value has to be base64-encoded as well which is not so nice to read (this is not nice but probably acceptable)
Issue #1 is maybe a litte bit artificial since I currently only really need the base64 encoding/decoding for Strings, but I was curious how the best way to handle it with picocli would look like and if that there is a way to just have some global preprocessing for all parameters?
Thanks a lot for any comments and help!
Sven
--
You received this message because you are subscribed to the Google Groups "picocli" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picocli+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picocli/96ef3bd3-e04e-4f83-b41b-f659da7ab1a4n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picocli/d8aadab6-f601-40d7-99ff-91f8814efcban%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "picocli" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/picocli/kNjVIrFOqlY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picocli+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picocli/CAAFrFhT8S9ZtHGSRFyPJW8yCs5_k9qp-2Tf%3DuyjAEntJ_qJgTg%40mail.gmail.com.
Is 2024 Buy 25I-NBOMe 500g Online Blotter for Sale Online:https://telegram.me/NextdoormarketThis powerful psychedelic drug was first synthesized in 2003 by German chemist Ralph Heim. It is typically sold as a liquid, although it can also be found in tablet or gel form. These effects are unpredictable and can vary significantly from person to person. Despite its illegal status, likewise, it is widely available on the internet.
Types of blotter:
There are multiple types available in this paper 25i-NBOMe blotter is one the well-known. This hallucinate drug made by the 2-(4-Iodo-2,5-dimethoxyphenyl)-N-[(2-methoxyphenyl)methyl]ethanamine, or 25I-NBOMe. Also, it was found to be a powerful serotonin 2A (5-HT2A) receptor agonist
Buy 25i-NBOMe Blotter USA:https://psychedelicshaven.com/product/25i-nbome-500g/This is a very potent drug, with just a tiny amount producing powerful effects. The effects of this drug are unpredictable and vary depending on the individual, the dose, the environment, and other factors. It can cause visual and auditory hallucinations, changes in perception, feelings of euphoria or anxiety, and changes in mood and behaviour.
How to Order 25i Nbome Online?
25i-NBOMe Blotter Dosage :https://psychedelicshaven.com/product/25i-nbome-500g/Though it's illegal, that doesn't stop people from trying to buy it online. While many websites claim to sell 25i-NBOMe, being careful is essential. Reviews show how powerful this powder is.
Positive Effects of Include:
It is considered a Schedule I drug in the United States, meaning it has a high potential for abuse and is not considered safe for medical use.
- Increased sense of well-being
- Increased creativity
- Improved mood
- Improved mental clarity
- Hallucinations
Short-Term side effects
- anxiety
- paranoia
- hallucinations
- flashbacks
- psychosis
https://psychedelicshaven.com/product/buy-ketamine-powder-online/
https://psychedelicshaven.com/product/yg-og-marijuana-rapper-strain/
https://psychedelicshaven.com/product/buy-3-cmc-crystal-online/
https://psychedelicshaven.com/product/3-pack-mix-and-match-thc-chocolates/
https://psychedelicshaven.com/product/purchase-200ug-1p-lsd/
https://psychedelicshaven.com/product-category/ayahuasca/
https://psychedelicshaven.com/product-category/psilocybin-mushroom/
https://psychedelicshaven.com/product-category/other-psychedelics/
https://psychedelicshaven.com/product-category/marijuana-flowers/
https://psychedelicshaven.com/product/buy-aura-extract-mini-thc-bar/
https://psychedelicshaven.com/product/gelato-strain/
https://psychedelicshaven.com/product/ak-47-strain/
https://psychedelicshaven.com/product/purchase-best-2024-1p-lsd/
https://psychedelicshaven.com/product/buy-tresiba-flextouch-pens/
https://psychedelicshaven.com/product/iboga-ta-extract/
https://psychedelicshaven.com/product/shop-aura-extract-mini-thc-bar/
https://psychedelicshaven.com/product/skywalker-og-strain/
https://psychedelicshaven.com/product/chemdawg/
https://psychedelicshaven.com/product/ketamine-for-sale-bulk-delivery/
https://psychedelicshaven.com/product/purchase-xanax-xr-3-mg/
https://psychedelicshaven.com/product/yellow-xanax-bar-2-mg/
https://psychedelicshaven.com/product/iboga-pta-extract/
https://psychedelicshaven.com/product/green-xanax-bars-2mg/
https://psychedelicshaven.com/product/2024-best-white-xanax-bars/
https://psychedelicshaven.com/product/you-can-purchase-xanax/
https://psychedelicshaven.com/product/new-wonder-psilocybin-gummies/
https://psychedelicshaven.com/product/purchase-integral-alchemist/
https://psychedelicshaven.com/product/ethereal-essence-4aco-dmt-tincture/
https://psychedelicshaven.com/product/bright-future-milk-chocolate/
https://psychedelicshaven.com/product/2024-dancing-tiger-magic-mushrooms/
https://psychedelicshaven.com/product/best-2024-golden-teacher-mushrooms/
https://psychedelicshaven.com/product/best-2024-penis-envy-mushrooms/
https://psychedelicshaven.com/product/buy-shafaa-heal-macrodose/
https://psychedelicshaven.com/product/best-2024-mazatapec-mushrooms/
https://psychedelicshaven.com/product/purchase-the-best-mastermind/
https://psychedelicshaven.com/product/buy-the-best-room-920-hot/
https://psychedelicshaven.com/product/2024-best-puff-boyz/
https://psychedelicshaven.com/product/2024-best-5ml-dmt-vape/
https://psychedelicshaven.com/product/buy-2024-best-fentanyl-for-sale-now-available/
https://psychedelicshaven.com/product/is-2024-buy-oxycontin-op/
https://psychedelicshaven.com/product/is-2024-buy-opana-er/
https://psychedelicshaven.com/product/purchase-codeine-phosphate/
https://psychedelicshaven.com/product/dank-vapes/
https://psychedelicshaven.com/product/is-2024-buy-valium-is-now-available/
https://psychedelicshaven.com/product/25i-nbome-500g/