From 5e0833d3727870a99a448e172e2dc80b9f045bb8 Mon Sep 17 00:00:00 2001 From: Sam Mangham Date: Thu, 12 Oct 2023 12:08:33 +0100 Subject: [PATCH] Added dependencies and CLI function to project, and documented --- README.md | 15 +++++++++++++++ pyproject.toml | 9 ++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) 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"