Skip to content

Commit c4ef8bf

Browse files
authored
Fix shorthands (#53)
- Add -m shorthand for commit --message - Add -e shorthand for cherry-pick --edit - Add -h shorthand for global and subcommand --help - Clean up unused imports
1 parent 855b7ae commit c4ef8bf

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

git_sim/__main__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import argparse
2-
import datetime
3-
import os
41
import pathlib
5-
import subprocess
6-
import sys
7-
import time
82

93
import typer
104

@@ -23,7 +17,7 @@
2317
import git_sim.tag
2418
from git_sim.settings import ImgFormat, VideoFormat, settings
2519

26-
app = typer.Typer()
20+
app = typer.Typer(context_settings={"help_option_names": ["-h", "--help"]})
2721

2822

2923
@app.callback(no_args_is_help=True)

git_sim/cherrypick.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ def cherry_pick(
7676
help="The ref (branch/tag), or commit ID to simulate cherry-pick onto active branch",
7777
),
7878
edit: str = typer.Option(
79-
default=None,
79+
None,
80+
"--edit",
81+
"-e",
8082
help="Specify a new commit message for the cherry-picked commit",
8183
),
8284
):

git_sim/commit.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ def populate_zones(
102102

103103
def commit(
104104
message: str = typer.Option(
105-
default="New commit",
105+
"New commit",
106+
"--message",
107+
"-m",
106108
help="The commit message of the new commit",
107109
),
108110
amend: bool = typer.Option(

0 commit comments

Comments
 (0)