From b7b719a3e2159bc2f5a7106b2befcb4b8e9cb774 Mon Sep 17 00:00:00 2001 From: fafnir Date: Sat, 15 Jun 2024 03:59:16 +1000 Subject: [PATCH] feat: updating docs and fixing import error --- README.md | 15 ++++++++++++++- git_chkfrq/cli.py | 11 ++++++++++- git_chkfrq/utils.py | 3 ++- setup.py | 1 - 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ea443ae..8a95bc9 100644 --- a/README.md +++ b/README.md @@ -1 +1,14 @@ -# git-chfrq \ No newline at end of file +# git-chfrq + +## Installation +``` +git clone git@github.com:fafnirZ/git-chkfrq.git +cd git-chkfrq/ + +pip3 install . +``` + +this should install the `git-chkfrq` command + +## Usage +run `git-chkfrq` for some usage instructions and notes \ No newline at end of file diff --git a/git_chkfrq/cli.py b/git_chkfrq/cli.py index 9a09173..892ffac 100644 --- a/git_chkfrq/cli.py +++ b/git_chkfrq/cli.py @@ -16,7 +16,16 @@ def main(): if len(sys.argv) != 3: - print("Usage: python3 -m git-chfrq {path_to_repo} {date_expr}") + print("Usage: git-chkfrq {path_to_repo} {date_expr}") + example_str = ( + "Example:\n" + " git-chkfrq ./ 9d\n" + " git-chkfrq ./ 1y\n\n" + "allowed date_expression regex: (-)?[0-9]+(d|m|y)\n" + "NOTE: it will always be a relative time from now to a point in the past\n" + "as you cannot compare with future commits that do not exist\n" + ) + print(example_str) exit(1) # get where user is executing the script diff --git a/git_chkfrq/utils.py b/git_chkfrq/utils.py index 1969602..013d970 100644 --- a/git_chkfrq/utils.py +++ b/git_chkfrq/utils.py @@ -1,9 +1,10 @@ import math import re from git.diff import Diff -from pathlib import Path from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta +from git import Repo + def continguous_zip(l: list): """generated by gpt diff --git a/setup.py b/setup.py index a149c58..7a1aac7 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,6 @@ install_requires=[ 'GitPython', 'python-dateutil', - 'pathlib', ], entry_points={ 'console_scripts': [