Skip to content

Commit

Permalink
feat: add max_item_size_in_bytes global option
Browse files Browse the repository at this point in the history
Signed-off-by: chris1320 <[email protected]>
  • Loading branch information
Chris1320 committed Dec 29, 2023
1 parent 7c4d18b commit ed2f27f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions copyt/_cli_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
global_options: GlobalOptions = GlobalOptions(
json=False,
max_items=750,
max_item_size_in_bytes=1024 * 1024 * 5, # 5MB
verbose=False,
cache_dir=helpers.get_program_cache_dir(
os.getenv("XDG_CACHE_HOME") or pathlib.Path(pathlib.Path.home(), ".cache")
Expand All @@ -52,6 +53,7 @@
def main_callback(
json: bool = global_options.json,
max_items: int = global_options.max_items,
max_item_size: int = global_options.max_item_size_in_bytes,
verbose: bool = global_options.verbose,
cache_path: Optional[str] = None,
text_encoding: str = global_options.text_encoding,
Expand All @@ -62,6 +64,7 @@ def main_callback(

global_options.json = json
global_options.max_items = max_items
global_options.max_item_size_in_bytes = max_item_size
global_options.verbose = verbose
global_options.cache_dir = cache_path or global_options.cache_dir
global_options.text_encoding = text_encoding
Expand Down
1 change: 1 addition & 0 deletions copyt/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class GlobalOptions:

json: bool
max_items: int
max_item_size_in_bytes: int
verbose: bool
cache_dir: str | pathlib.Path

Expand Down

0 comments on commit ed2f27f

Please sign in to comment.