diff --git a/README.md b/README.md index 049492f..ad7043c 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,21 @@ print(f"{n}{km.abbr} in {mile} = {km.to_unit(n, mile)}") ### CLI +The converter can also be run as a command-line tool. +Once it's been installed, it can be run in your terminal as: + +```bash +oxrse-unit-conv 42 km mile +``` + +Help is available using: + +```bash +oxrse-unit-conv --help +``` + + + ## Development ### Structure diff --git a/pyproject.toml b/pyproject.toml index 23e0119..ede71d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,11 +13,18 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] +dependencies = [ + "click" +] + +[project.scripts] +oxrse-unit-conv = "oxrse_unit_conv.main:click_convert" [project.urls] "Homepage" = "https://github.com/OxfordRSE/oxrse_unit_conv" "Bug Tracker" = "https://github.com/OxfordRSE/oxrse_unit_conv/issues" + [build-system] requires = ["hatchling"] -build-backend = "hatchling.build" \ No newline at end of file +build-backend = "hatchling.build"