Click-params: a little companion to your click project

An image showing a terminal loading a software
Photo by Jake Walker on Unsplash
Example usage of click-params type
$ cream -f passion,mint,strawberry
- passion
- mint
- strawberry
$ cream
Flavors: passion,mint
- passion
- mint
Example of click-params type instantiated with a space
$ ip -d "facebook.com google.com"
facebook.com -> 157.240.21.35
google.com -> 142.250.179.110
$ ip
Domains: facebook.com google
Error: These items are not domain names: ['google']
Domains: facebook.com google.com
facebook.com -> 157.240.21.35
google.com -> 142.250.178.142
  • Here we instantiate the parameter with a single space as argument which means that the values must be separated by a space.
  • If you look at the second usage, I deliberately added a wrong domain to show that the validation takes place.
Testing example with click-params utility functions

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kevin Tewouda

Kevin Tewouda

69 Followers

Déserteur camerounais résidant désormais en France. Passionné de programmation, sport, de cinéma et mangas. J’écris en français et en anglais dû à mes origines.