Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit 4d2d7ac

Browse files
committed
chore: setup argparse
1 parent 2c80574 commit 4d2d7ac

4 files changed

Lines changed: 32 additions & 7 deletions

File tree

main.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@ name = "sb2git"
33
version = "0.1.0"
44
description = "Add your description here"
55
readme = "README.md"
6+
authors = [{ name = "faretek", email = "r@faretek.dev" }]
67
requires-python = ">=3.12"
78
dependencies = []
89

10+
[project.scripts]
11+
sb2git = "sb2git:main"
12+
13+
[build-system]
14+
requires = ["uv_build>=0.9.26,<0.10.0"]
15+
build-backend = "uv_build"
16+
917
[dependency-groups]
1018
dev = [
1119
"zensical>=0.0.23",

src/sb2git/__init__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import argparse
2+
import typing as t
3+
4+
5+
class ArgNamespace(argparse.Namespace):
6+
path: str
7+
8+
9+
def main() -> None:
10+
parser = argparse.ArgumentParser(
11+
"sb2git",
12+
"`sb2git .`",
13+
"Converter from sb3 directory to git repo",
14+
"gh: https://github.com/scratch-api/sb2git",
15+
)
16+
17+
parser.add_argument("path", type=str)
18+
args = parser.parse_args(namespace=ArgNamespace())
19+
run(args)
20+
21+
22+
def run(args: ArgNamespace):
23+
print(f"Hello from sb2git! {args}")

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)