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

MIT license

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

  1. Create a hashmap of two countries: Germany 🇩🇪 and France 🇫🇷 .
  2. When the user types in Germany 🇩🇪 they get back 🇩🇪
  3. When the user types in France they get back 🇫🇷.
  4. Case insensitive e.g. running flagup
  5. Get it running as a homebrew package using https://federicoterzi.com/blog/how-to-publish-your-rust-project-on-homebrew/
  6. Has a test for France and Germany.
  7. Has a test for when the country does not exist => adds a 🤷‍♂️
  8. Use other countries as well (e.g. Andorra)
  9. Split up the packages to cli and lib like https://github.com/mitsuhiko/when/commit/194eab88d9b05dc4799166720dff42cdaaabf810
  10. 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
  11. Make all tests doc tests.

TODO

  1. Need to change the git commit user name to cthogg and not the christopher-luminovo one
  2. Support countries with spaces e.g. (Ascension Island) -> see comment by colleague
  3. Use multiple lanugages i.e. Deutschland -> 🇩🇪.
  4. Bug: on my vscode terminal runnig it returns a box and not an emoji. Think more of a vscode bug though.
  5. Get a webstite running wasm with something similar to https://github.com/mitsuhiko/when.
  6. Get a reverse search e.g. 🇩🇪 -> Germany
  7. Get a description parse the information to https://en.wikipedia.org/wiki/Flag_of_Germany. (e.g. country with red gold and black flag)
  8. Add suggestions => e.g. typing Ger brings up "did you mean Germany"?
  9. Automatically publishes to crates.io and homebrew.

Dependencies

~1.1–8.5MB
~73K SLoC