From 78e40bfe8df2067c254633e4b9059a88eb14aa37 Mon Sep 17 00:00:00 2001 From: Gang Li Date: Thu, 28 Mar 2024 15:48:53 +0800 Subject: [PATCH] Refine the command * Change checksum command name to checksum-validate * Refine some help messages for the command --- charon/cmd/__init__.py | 4 ++-- charon/cmd/cmd_cache.py | 5 +++-- charon/cmd/cmd_checksum.py | 15 ++++++++------- charon/cmd/cmd_index.py | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/charon/cmd/__init__.py b/charon/cmd/__init__.py index a2ccadaa..b2cafd05 100644 --- a/charon/cmd/__init__.py +++ b/charon/cmd/__init__.py @@ -17,7 +17,7 @@ from charon.cmd.cmd_upload import upload from charon.cmd.cmd_delete import delete from charon.cmd.cmd_index import index -from charon.cmd.cmd_checksum import validate +from charon.cmd.cmd_checksum import checksum_validate from charon.cmd.cmd_cache import cf_invalidate, cf_check @@ -33,6 +33,6 @@ def cli(): cli.add_command(upload) cli.add_command(delete) cli.add_command(index) -cli.add_command(validate) +cli.add_command(checksum_validate) cli.add_command(cf_invalidate) cli.add_command(cf_check) diff --git a/charon/cmd/cmd_cache.py b/charon/cmd/cmd_cache.py index ed874723..4aaedacb 100644 --- a/charon/cmd/cmd_cache.py +++ b/charon/cmd/cmd_cache.py @@ -82,7 +82,7 @@ def cf_invalidate( quiet: bool = False, debug: bool = False ): - """This command will do invalidating on AWS CloudFront for the specified paths. + """Do invalidating on AWS CloudFront for the specified paths. """ _decide_mode( f"cfclear-{target}", "", @@ -167,7 +167,8 @@ def cf_check( quiet: bool = False, debug: bool = False ): - """This command will check the invalidation status of the specified invalidation id. + """Check the invalidation status of the specified invalidation id + for AWS CloudFront. """ _decide_mode( f"cfcheck-{target}", "", diff --git a/charon/cmd/cmd_checksum.py b/charon/cmd/cmd_checksum.py index b06c01ce..1591df77 100644 --- a/charon/cmd/cmd_checksum.py +++ b/charon/cmd/cmd_checksum.py @@ -99,7 +99,7 @@ required=True ) @command() -def validate( +def checksum_validate( path: str, target: str, includes: List[str], @@ -109,12 +109,13 @@ def validate( quiet: bool = False, debug: bool = False ): - """This command will validate the checksum of the specified path for the - maven repository. It will calculate the sha1 checksum of all artifact - files in the specified path and compare with the companied .sha1 files - of the artifacts, then record all mismatched artifacts in the report file. - If some artifact files misses the companied .sha1 files, they will also - be recorded. + """ + Validate the checksum of the specified path for themaven repository. + It will calculate the sha1 checksum of all artifact files in the + specified path and compare with the companied .sha1 files of the + artifacts, then record all mismatched artifacts in the report file. + If some artifact files misses the companied .sha1 files, they will also + be recorded. """ _decide_mode( "checksum-{}".format(target), path.replace("/", "_"), diff --git a/charon/cmd/cmd_index.py b/charon/cmd/cmd_index.py index e9a3e18c..418b05e6 100644 --- a/charon/cmd/cmd_index.py +++ b/charon/cmd/cmd_index.py @@ -65,7 +65,7 @@ def index( quiet: bool = False, dryrun: bool = False ): - """This command will re-generate the index.html files for the + """Generate or refresh the index.html files for the specified path. """ _decide_mode(