Skip to content

Commit 10db811

Browse files
committed
better --help
1 parent 0d3a774 commit 10db811

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

src/gitfetch/cli.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
def parse_args() -> argparse.Namespace:
1818
"""Parse command-line arguments."""
1919
parser = argparse.ArgumentParser(
20-
description="A neofetch-style CLI tool for git provider statistics",
20+
description="""A neofetch-style CLI tool for git.
21+
Supports GitHub, GitLab, Gitea, and Sourcehut.""",
2122
formatter_class=argparse.RawDescriptionHelpFormatter
2223
)
2324

@@ -27,42 +28,44 @@ def parse_args() -> argparse.Namespace:
2728
help="Username to fetch stats for"
2829
)
2930

30-
parser.add_argument(
31+
general_group = parser.add_argument_group('General Options')
32+
general_group.add_argument(
3133
"--no-cache",
3234
action="store_true",
3335
help="Bypass cache and fetch fresh data"
3436
)
3537

36-
parser.add_argument(
38+
general_group.add_argument(
3739
"--clear-cache",
3840
action="store_true",
3941
help="Clear the cache and exit"
4042
)
4143

42-
parser.add_argument(
44+
general_group.add_argument(
4345
"--token",
4446
type=str,
45-
help="GitHub personal access token (optional, increases rate limits)"
47+
help="Personal access token (optional, increases rate limits)"
4648
)
4749

48-
parser.add_argument(
50+
general_group.add_argument(
51+
"--version",
52+
action="store_true",
53+
help="Show version and check for updates"
54+
)
55+
56+
visual_group = parser.add_argument_group('Visual Options')
57+
visual_group.add_argument(
4958
"--spaced",
5059
action="store_true",
5160
help="Enable spaced layout"
5261
)
5362

54-
parser.add_argument(
63+
visual_group.add_argument(
5564
"--not-spaced",
5665
action="store_true",
5766
help="Disable spaced layout"
5867
)
5968

60-
parser.add_argument(
61-
"--version",
62-
action="store_true",
63-
help="Show version and check for updates"
64-
)
65-
6669
return parser.parse_args()
6770

6871

0 commit comments

Comments
 (0)