Skip to content

Commit

Permalink
Nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jul 5, 2024
1 parent fad29b2 commit 44a4d96
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cli/trd.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def _progress(msg):
print(msg)


def _version():
return version("traduire_cli")


def current_project():
config = Path.home() / ".config" / "traduire.toml"
if not config.exists():
Expand Down Expand Up @@ -51,13 +55,15 @@ def url_from_pofile(project, pofile):

def main():
if len(sys.argv) != 3 or sys.argv[1] not in {"get", "submit", "replace"}:
_terminate(f"Usage: {sys.argv[0]} [get,submit,replace] path")
_terminate(
f"traduire-cli {_version()}\nUsage: {Path(sys.argv[0]).name} [get,submit,replace] path"
)

project = current_project()
session = requests.Session()
session.headers = {
"x-token": project["token"],
"x-cli-version": version("traduire_cli"),
"x-cli-version": _version(),
}

if sys.argv[1] == "get":
Expand Down

0 comments on commit 44a4d96

Please sign in to comment.