Skip to content

Commit 0ee8c8f

Browse files
committed
feat(config): add CLI arg parsing and fallback logic
- Add clap-based CLI parser with robust LSP passthrough fallback - CLI args override config file fields for container, paths, exec, etc. - Support `--` separator for unambiguous LSP argument forwarding - Auto-detect executable name from binary for proxy replacement - Refactor config loading to merge CLI and file sources - Remove encoded_local_path; use local_path normalization and encoding - Update Windows path handling and binary name extraction - Add fallback to local LSP if Docker attach fails - Update docs and examples for new CLI usage and argument precedence
1 parent e3a32fe commit 0ee8c8f

File tree

14 files changed

+655
-223
lines changed

14 files changed

+655
-223
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,57 @@ jobs:
8282
if: startsWith(github.ref, 'refs/tags/v')
8383

8484
steps:
85+
- name: Checkout repository
86+
uses: actions/checkout@v5
87+
with:
88+
fetch-depth: 0 # Fetch all history for changelog generation
89+
8590
- name: Download all build artifacts
8691
uses: actions/download-artifact@v5
8792
with:
8893
path: dist
89-
94+
95+
- name: Generate release notes
96+
id: release_notes
97+
run: |
98+
# Get the previous tag
99+
PREV_TAG=$(git tag --sort=-v:refname | sed -n '2p')
100+
CURRENT_TAG=${GITHUB_REF#refs/tags/}
101+
102+
# Generate changelog
103+
if [ -z "$PREV_TAG" ]; then
104+
# First release - use all commits
105+
CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges)
106+
else
107+
# Generate changelog between tags
108+
CHANGELOG=$(git log ${PREV_TAG}..${CURRENT_TAG} --pretty=format:"- %s (%h)" --no-merges)
109+
fi
110+
111+
# Create release notes
112+
cat > release_notes.md << EOF
113+
## What's Changed
114+
115+
${CHANGELOG}
116+
117+
## Installation
118+
119+
Download the appropriate binary for your platform:
120+
- **Linux (x86_64)**: \`lspdock-x86_64-unknown-linux-gnu.tar.gz\`
121+
- **Windows (x86_64)**: \`lspdock-x86_64-pc-windows-gnu.zip\`
122+
- **macOS (Apple Silicon)**: \`lspdock-aarch64-apple-darwin.tar.gz\`
123+
124+
Extract and place the binary in your PATH.
125+
126+
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${CURRENT_TAG}
127+
EOF
128+
129+
echo "Generated release notes"
130+
90131
- name: Create GitHub Release
91132
uses: softprops/action-gh-release@v2
92133
with:
93134
files: dist/**/*
135+
body_path: release_notes.md
136+
draft: false
137+
prerelease: false
138+
generate_release_notes: false

.github/workflows/test.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,10 @@ jobs:
5353
with:
5454
targets: ${{ matrix.platform.target }}
5555

56-
- name: Cache cargo registry
57-
uses: actions/cache@v4
56+
- name: Setup Rust cache
57+
uses: Swatinem/rust-cache@v2
5858
with:
59-
path: ~/.cargo/registry
60-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
61-
62-
- name: Cache cargo index
63-
uses: actions/cache@v4
64-
with:
65-
path: ~/.cargo/git
66-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
67-
68-
- name: Cache cargo build
69-
uses: actions/cache@v4
70-
with:
71-
path: target
72-
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
59+
key: ${{ matrix.platform.target }}
7360

7461
- name: Install cross
7562
if: matrix.platform.use_cross

Cargo.lock

Lines changed: 132 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[package]
22
name = "lspdock"
3-
version = "0.1.8"
3+
version = "0.2.0"
44
edition = "2024"
55

66
[dependencies]
7+
clap = { version = "4.5.53", features = ["derive"] }
78
dirs = "6.0.0"
89
futures-core = "0.3.31"
910
memchr = "2.7.6"

0 commit comments

Comments
 (0)