diff --git a/pyproject.toml b/pyproject.toml index 5c2f612..f0ca4db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "searchcode" -version = "0.4.2" +version = "0.4.4" description = "Simple, comprehensive code search." authors = ["Ritchie Mwewa "] license = "GPLv3+" diff --git a/searchcode/__init__.py b/searchcode/__init__.py index cb63a3d..d4c7500 100644 --- a/searchcode/__init__.py +++ b/searchcode/__init__.py @@ -15,10 +15,12 @@ along with this program. If not, see . """ +from datetime import datetime + from .api import Searchcode __pkg__ = "searchcode" -__version__ = "0.4.2" +__version__ = "0.4.4" __author__ = "Ritchie Mwewa" @@ -576,7 +578,7 @@ class License: [bold]END OF TERMS AND CONDITIONS[/] """ - warranty: str = """ + warranty: str = f""" Copyright (C) {datetime.today().year} {__author__} This program is free software: you can redistribute it and/or modify diff --git a/searchcode/cli.py b/searchcode/cli.py index 7c047b0..0f1e464 100644 --- a/searchcode/cli.py +++ b/searchcode/cli.py @@ -52,9 +52,12 @@ def cli(): @cli.command("license") @click.option("--conditions", help="License terms and conditions.", is_flag=True) @click.option("--warranty", help="License warranty.", is_flag=True) -def licence(conditions: t.Optional[bool], warranty: t.Optional[bool]): +@click.pass_context +def licence( + ctx: click.Context, conditions: t.Optional[bool], warranty: t.Optional[bool] +): """ - Show license + Show license information """ __clear_screen() __update_window_title( @@ -66,12 +69,14 @@ def licence(conditions: t.Optional[bool], warranty: t.Optional[bool]): justify="center", style="on #272822", # monokai themed background :) ) - if warranty: + elif warranty: console.print( License.warranty, justify="center", style="on #272822", ) + else: + click.echo(ctx.get_help()) @cli.command()