4 releases
0.0.8 | Aug 13, 2022 |
---|---|
0.0.6 | Aug 13, 2022 |
0.0.5 | Aug 13, 2022 |
0.0.4 | Aug 13, 2022 |
#1458 in Text processing
17KB
flagup
- Have a French friend and want to have a present with their flag but do not know what the French flag is?
- Struggle in the flag round of your local pub quiz?
- Ever at the Olympics, a French Athelete wins and asks to you to find their flag (but are too embarassed to say you do not know what the flag of France is)?
If you answered Yes to any of these questions, then flagup is for you.
Simply type in the name of the country (in English) and intelligent alogorithm will show the correct flag for you!
Packages
- cli: the command line application.
- libflagup: the library package. Also available from crates.io.
Installation (mac-os)
brew tap cthogg/flagup
brew install flagup
Generate package for homebrew
Follow the instructions here or run the command.
cargo test && cargo build --release && cd target/release && tar -czf flagup-mac.tar.gz flagup && shasum -a 256 flagup-mac.tar.gz >256-flagup.txt
Features
Done
- Create a hashmap of two countries: Germany 🇩🇪 and France 🇫🇷 .
- When the user types in Germany 🇩🇪 they get back 🇩🇪
- When the user types in France they get back 🇫🇷.
- Case insensitive e.g. running flagup
- Get it running as a homebrew package using https://federicoterzi.com/blog/how-to-publish-your-rust-project-on-homebrew/
- Has a test for France and Germany.
- Has a test for when the country does not exist => adds a 🤷♂️
- Use other countries as well (e.g. Andorra)
- Split up the packages to cli and lib like https://github.com/mitsuhiko/when/commit/194eab88d9b05dc4799166720dff42cdaaabf810
- Publish to a crate on crates.io with one public function of flagup("Germany") -> 🇩🇪 See https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html
- Make all tests doc tests.
TODO
- Need to change the git commit user name to cthogg and not the christopher-luminovo one
- Support countries with spaces e.g. (Ascension Island) -> see comment by colleague
- Use multiple lanugages i.e. Deutschland -> 🇩🇪.
- Bug: on my vscode terminal runnig it returns a box and not an emoji. Think more of a vscode bug though.
- Get a webstite running wasm with something similar to https://github.com/mitsuhiko/when.
- Get a reverse search e.g. 🇩🇪 -> Germany
- Get a description parse the information to https://en.wikipedia.org/wiki/Flag_of_Germany. (e.g. country with red gold and black flag)
- Add suggestions => e.g. typing Ger brings up "did you mean Germany"?
- Automatically publishes to crates.io and homebrew.
Dependencies
~1.1–8.5MB
~73K SLoC