feat: add version subcommand
This commit is contained in:
parent
af8b9b7c52
commit
8267ec6644
4 changed files with 31 additions and 18 deletions
1
halig/__version__.py
Normal file
1
halig/__version__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
__version__ = "0.1.8"
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
COMMANDS_NOTEBOOKS_HELP = "List all notebooks and notes, tree-style"
|
||||
COMMANDS_EDIT_HELP = "Edit or add a note into a notebook"
|
||||
COMMANDS_SHOW_HELP = "Show a note's contents"
|
||||
COMMANDS_VERSION = "Show halig's version"
|
||||
|
||||
# OPTIONS
|
||||
OPTION_CONFIG_HELP = "Configuration file. Must be YAML and schema compatible"
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ from halig.commands.notebooks import NotebooksCommand
|
|||
from halig.commands.show import ShowCommand
|
||||
from halig.settings import load_from_file
|
||||
from halig.utils import capture
|
||||
from halig.__version__ import __version__
|
||||
from rich import print
|
||||
|
||||
app = Typer(pretty_exceptions_enable=False, pretty_exceptions_show_locals=False)
|
||||
|
||||
|
|
@ -62,5 +64,11 @@ def show(
|
|||
command.run()
|
||||
|
||||
|
||||
@app.command(help=literals.COMMANDS_VERSION)
|
||||
@capture
|
||||
def version():
|
||||
print(__version__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app()
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ dependencies = [
|
|||
"pendulum>=2.1.2",
|
||||
]
|
||||
name = "halig"
|
||||
version = "0.1.7"
|
||||
dynamic = ["version"]
|
||||
description = "age-encrypted, file-based, note-taking CLI app"
|
||||
readme = "README.md"
|
||||
keywords = ["cli", "notes", "age", "rage", "encryption", "notebook"]
|
||||
|
|
@ -36,6 +36,9 @@ Repository = "https://git.roboces.dev/catalin/halig"
|
|||
Documentation = "https://git.roboces.dev/catalin/halig"
|
||||
Changelog = "https://git.roboces.dev/catalin/halig"
|
||||
|
||||
[tool.pdm]
|
||||
version = { source = "file", path = "halig/__version__.py" }
|
||||
|
||||
[tool.pdm.build]
|
||||
excludes = ["**/.pytest_cache/**"]
|
||||
includes = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue