Skip to content

Commit

Permalink
feat: add --version (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
yurijmikhalevich authored Aug 2, 2023
1 parent be64d95 commit 3f4b30c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,21 @@
</details>

<details>
<summary><strong>macOS/Windows/Linux (using <code>pip</code>)</strong></summary>
<summary><strong>macOS or Windows (using <code>pip</code>)</strong></summary>

```bash
pip install rclip
```
</details>

<details>
<summary><strong>Linux (using <code>pip</code>)</strong></summary>

```bash
pip install --extra-index-url https://download.pytorch.org/whl/cpu rclip
```
</details>

## Usage

```bash
Expand Down
2 changes: 1 addition & 1 deletion appimage-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AppDir:
# Set the python executable as entry point
exec: usr/bin/python3.8
# Set the application main script path as argument. Use '$@' to forward CLI parameters
exec_args: "${APPDIR}/usr/src/rclip/main.py $@"
exec_args: "${APPDIR}/usr/bin/rclip $@"

apt:
arch: amd64
Expand Down
4 changes: 2 additions & 2 deletions appimage_after_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ PYTHONHOME=$APPDIR/usr \
PYTHONPATH=$APPDIR/usr/lib/python3.8/site-packages:$APPDIR/usr/lib/python3.8 \
LD_LIBRARY_PATH=$APPDIR/usr/lib/x86_64-linux-gnu \
python3.8 -m pip install poetry==1.5.1 &&
python3.8 -m poetry export --without-hashes --without dev -f requirements.txt --output requirements.txt &&
python3.8 -m pip install --upgrade --isolated --no-input --ignore-installed --prefix="$APPDIR/usr" certifi setuptools wheel &&
python3.8 -m pip install --upgrade --isolated --no-input --ignore-installed --prefix="$APPDIR/usr" -r ./requirements.txt
python3.8 -m poetry build &&
python3.8 -m pip install --extra-index-url https://download.pytorch.org/whl/cpu --upgrade --isolated --no-input --ignore-installed --prefix="$APPDIR/usr" dist/*.whl
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "rclip"
version = "1.4.6"
version = "1.4.7a11"
description = "AI-Powered Command-Line Photo Search Tool"
authors = ["Yurij Mikhalevich <[email protected]>"]
license = "MIT"
Expand Down
3 changes: 3 additions & 0 deletions rclip/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import re
import requests
import sys
from importlib.metadata import version


MAX_DOWNLOAD_SIZE_BYTES = 50_000_000
Expand Down Expand Up @@ -61,6 +62,8 @@ def init_arg_parser() -> argparse.ArgumentParser:
' adding a multiplier is especially useful when combining image and text queries because'
' image queries are usually weighted more than text ones\n',
)
version_str = f'rclip {version("rclip")}'
parser.add_argument('--version', '-v', action='version', version=version_str, help=f'prints "{version_str}"')
parser.add_argument('query', help='a text query or a path/URL to an image file')
parser.add_argument('--add', '-a', '+', metavar='QUERY', action='append', default=[],
help='a text query or a path/URL to an image file to add to the "original" query,'
Expand Down

0 comments on commit 3f4b30c

Please sign in to comment.