Add support for option modifiers
See original GitHub issueThe programmer can enable modifiers for options which changes how the cli interprets the value for the option. Inspired by the Java Keytool
For example:
-option value
would use the value directly for option.
-option:env value
would treat value as a environment variable to look up for the actual value to supply to option.
-option:file value
would treat value as a path to a file to read for the value supplied to option
Useful for application wishing to hide sensitive information, such as passwords, from the command line.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Create and Manage Item Modifiers | Square Support Center - US
Enter a name for the modifier set and select the items you'd like to apply it to. Toggle on Customer must only select...
Read more >Advanced Modifier Features - Revel Support
Go to the Products tab. Click the icon in line with the modifier class. Click the checkbox labeled Allow Split Modifiers: Click Save....
Read more >Option Rules vs Modifiers - BigCommerce Support
Any adjusters you set via API for a modifier will be found in the Rules section under Modifiers within the control panel, these...
Read more >Modifiers - ShopKeep Support - Lightspeed
Learn about modifiers! Allow customers to request add-ons, substitute or request 'no' to customize basic inventory items. Watch our Youtube tutorial video!
Read more >Add support for keep option modifier `includecode` [134838460]
Specifies that code attributes of the methods that the -keep option keeps should be kept as well, i.e. may not be optimized or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
To summarize, the password prompting feature is covered by this ticket: #82. Other than that,
-option
,-option:env
and-option:file
options are treated as separate options by picocli, which provides the building blocks to build a custom solution as described in my previous comment.I won’t look further at providing special library support for option modifiers, unless something new comes up.
Still this is a good idea to either write an article about or mention in the user manual after #82 is implemented. (I added this to the list in the wiki: https://github.com/remkop/picocli/wiki/Plans-and-Notes-for-Future-Articles)
I’ve thought about this some more and I was wondering if special support is really needed. One can already do this:
The usage help for such a class looks exactly as one would expect:
Wouldn’t it be better to leave the next step (calling
System.getenv(args.optionEnvKey)
orFiles.readAllBytes(optionFile.toPath())
) to the application?