Skip to content

Commit 2b02b47

Browse files
committed
Fix unformatted year in __init__.py
1 parent 7425cf2 commit 2b02b47

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "searchcode"
3-
version = "0.4.2"
3+
version = "0.4.4"
44
description = "Simple, comprehensive code search."
55
authors = ["Ritchie Mwewa <rly0nheart@duck.com>"]
66
license = "GPLv3+"

searchcode/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
along with this program. If not, see <https://www.gnu.org/licenses/>.
1616
"""
1717

18+
from datetime import datetime
19+
1820
from .api import Searchcode
1921

2022
__pkg__ = "searchcode"
21-
__version__ = "0.4.2"
23+
__version__ = "0.4.4"
2224
__author__ = "Ritchie Mwewa"
2325

2426

@@ -576,7 +578,7 @@ class License:
576578
577579
[bold]END OF TERMS AND CONDITIONS[/]
578580
"""
579-
warranty: str = """
581+
warranty: str = f"""
580582
Copyright (C) {datetime.today().year} {__author__}
581583
582584
This program is free software: you can redistribute it and/or modify

searchcode/cli.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@ def cli():
5252
@cli.command("license")
5353
@click.option("--conditions", help="License terms and conditions.", is_flag=True)
5454
@click.option("--warranty", help="License warranty.", is_flag=True)
55-
def licence(conditions: t.Optional[bool], warranty: t.Optional[bool]):
55+
@click.pass_context
56+
def licence(
57+
ctx: click.Context, conditions: t.Optional[bool], warranty: t.Optional[bool]
58+
):
5659
"""
57-
Show license
60+
Show license information
5861
"""
5962
__clear_screen()
6063
__update_window_title(
@@ -66,12 +69,14 @@ def licence(conditions: t.Optional[bool], warranty: t.Optional[bool]):
6669
justify="center",
6770
style="on #272822", # monokai themed background :)
6871
)
69-
if warranty:
72+
elif warranty:
7073
console.print(
7174
License.warranty,
7275
justify="center",
7376
style="on #272822",
7477
)
78+
else:
79+
click.echo(ctx.get_help())
7580

7681

7782
@cli.command()

0 commit comments

Comments
 (0)