From 6767e239045996b96b4fc24b127acff2717482f0 Mon Sep 17 00:00:00 2001 From: Conor Sheehan Date: Mon, 13 Apr 2020 20:19:28 +0100 Subject: [PATCH] add notes on using from python. --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 38478f0..3376666 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,18 @@ osxdocker ![clear_log_example](.github/images/clear_log_example.png) This cli uses https://github.com/google/python-fire -Check out the docs for more details on usage, setting up bash completion, etc. -Also worth noting this cli doesn't support --version due to a quirk with fire. -```bash -osxdocker version # works fine -osxdocker --version # won't work -``` +Check out the docs for more details on usage, setting up bash completion, etc. +Also worth noting: +1. Because the package uses fire, it can be imported like a normal python package. e.g. + ```python + from osxdocker.docker_logs import DockerLogs + DockerLogs().log_path('foo') + ``` +2. This cli doesn't support `--version` due to a quirk with fire. + ```bash + osxdocker version # works fine + osxdocker --version # won't work + ``` #### Edge cases and gotchas Container names are unique, but containers are filtered by regex, so you can still run into issues.