Skip to content

Commit a5ebb45

Browse files
authored
docs: Add CLI documentation and version flag support (#46)
## Summary Adds CLI documentation infrastructure and improves CLI usability: - **CLI**: `g --version` / `g -V` now shows g's version (previously passed to VCS) - **Documentation**: New [CLI documentation page](https://g.git-pull.com/cli/) with complete command reference - **Documentation**: Linkable argument anchors (headerlinks) for easy sharing - **Documentation**: Semantic CLI markup roles and syntax highlighting ## User-facing changes ### CLI - `g --version` and `g -V` display g's version instead of being passed to the underlying VCS - Documentation now accurately describes this behavior ### Documentation - New CLI page at `/cli/` with argparse-generated command reference - CLI arguments have linkable anchors (¶ headerlinks) - Improved CSS for light/dark mode compatibility ## Technical changes - Added `docs/_ext/sphinx_argparse_neo/` - argparse documentation with headerlinks - Added `docs/_ext/argparse_lexer.py` - syntax highlighting for CLI output - Added `docs/_ext/argparse_roles.py` - semantic markup roles (`:cli-opt:`, `:cli-cmd:`, etc.) - Added `docs/_ext/argparse_exemplar.py` - epilog examples transformation - Added `docs/_static/css/argparse-highlight.css` - CLI styling - Added comprehensive test suite in `tests/docs/_ext/` - Updated `docs/conf.py` with extension configuration - Updated `pyproject.toml` with mypy overrides
2 parents 80e5695 + 6acece6 commit a5ebb45

34 files changed

Lines changed: 8648 additions & 8 deletions

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ g is a lightweight CLI wrapper that proxies to the current directory's VCS comma
1717

1818
Key features:
1919
- Detects VCS by walking parent directories and mapping `.git`, `.svn`, or `.hg`
20-
- Proxies CLI arguments directly to the detected VCS binary
20+
- Proxies CLI arguments to the detected VCS binary (--version/-V is handled by g)
2121
- Minimal surface area: primary logic lives in `src/g/__init__.py`
2222
- Test fixtures cover CLI behavior for both repo and non-repo directories
2323

CHANGES

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,25 @@ $ uvx --from 'g' --prerelease allow g
3333
_Notes on upcoming releases will be added here_
3434
<!-- END PLACEHOLDER - ADD NEW CHANGELOG ENTRIES BELOW THIS LINE -->
3535

36-
<!-- Maintainers, insert changes / features for the next release here -->
36+
### CLI
37+
38+
- `g --version` and `g -V` now display g's version instead of being passed to
39+
the underlying VCS (#46)
40+
41+
This makes it easier to check which version of g you have installed:
42+
43+
```console
44+
$ g --version
45+
g 0.0.10
46+
```
47+
48+
### Documentation
49+
50+
- Add [CLI documentation page](https://g.git-pull.com/cli/) with complete
51+
command reference (#46)
52+
53+
- CLI argument documentation now has linkable anchors (headerlinks) for easy
54+
sharing and reference (#46)
3755

3856
## g 0.0.9 (2026-01-24)
3957

docs/_ext/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Sphinx extensions for g documentation."""
2+
3+
from __future__ import annotations

0 commit comments

Comments
 (0)