From 56a75edf69c58bd52a8158541931f22d3c07ced7 Mon Sep 17 00:00:00 2001 From: DataHearth Date: Sun, 20 Feb 2022 18:39:10 +0100 Subject: [PATCH] update documentations --- README.md | 38 ++++++++++++++++++++++++++++---------- src/main.rs | 2 +- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 41436a1..aae2ed8 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # clear-docker-images -`clear-docker-images` is a small rust binary made to cleanup old docker images but date, repository and tags. +`clear-docker-images` is a small rust binary made to cleanup old docker images by date, repository and tags. ## Usage -By default (it will change in the futur), `clear-docker-images` will select images that are older than 2 days old by default. You can choose to customize its behavior by filtering by repository, tags and from a specific date. +By default, `clear-docker-images` will select images that are older than 2 days old. You can choose to customize its behavior by filtering a different date by passing 1 or 2 dates, a repository and tags. ### Docker container @@ -37,12 +37,30 @@ clear-docker-images ## Flags ```bash - -d, --date filter by repository name (ISO 8601) [default: $NOW - 2 days] - --dry-run image cleanup will not be triggered - --force should docker force image removal (it may create orphan images) - -h, --help Print help information - -r, --repository filter by repository name - -t, --tags add tags exclusion Example: -t 1.1.0 -t release - -v, --verbose add more logs - -V, --version Print version information + -d, --date + filter by date. + + Can filter by a minimum age $DATE or from $FROM|$TO (format example: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS) + [default: $NOW - 2 days] + + --dry-run + image cleanup will not be triggered [default: false] + + --force + force image removal [default: false] + + -h, --help + Print help information + + -r, --repository + filter by repository name + + -t, --tags + add tags exclusion + + -v, --verbose + add more logs [default: false] + + -V, --version + Print version information ``` diff --git a/src/main.rs b/src/main.rs index b73b9d8..725c994 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,7 +18,7 @@ const DOCKER_BIN: &str = "docker"; struct Args { /// filter by date. /// - /// Can filter by a minimum age $DATE or from $FROM|$TO (%Y-%m-%dT%H:%M:%S%Z) [default: $NOW - 2 days] + /// Can filter by a minimum age $DATE or from $FROM|$TO (format example: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS) [default: $NOW - 2 days] #[clap(short, long)] date: Option,