Skip to content

Commit 852fb53

Browse files
committed
Separate lib/bin, update README.md, release v1.0.0
1 parent f31edda commit 852fb53

File tree

10 files changed

+190
-103
lines changed

10 files changed

+190
-103
lines changed

.github/workflows/build.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
RUSTFLAGS: -D warnings
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
- name: Setup Rust toolchain
1919
uses: dtolnay/rust-toolchain@stable
2020
with:
@@ -35,7 +35,7 @@ jobs:
3535
# Prevent new advisories from failing CI
3636
continue-on-error: ${{ matrix.checks == 'advisories' }}
3737
steps:
38-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@v4
3939
- uses: EmbarkStudios/cargo-deny-action@v1
4040
with:
4141
command: check ${{ matrix.checks }}
@@ -49,7 +49,7 @@ jobs:
4949
runs-on: ${{ matrix.platform }}
5050
steps:
5151
- name: Checkout
52-
uses: actions/checkout@v3
52+
uses: actions/checkout@v4
5353
- name: Setup Rust toolchain
5454
uses: dtolnay/rust-toolchain@stable
5555
- name: Cargo test
@@ -87,7 +87,7 @@ jobs:
8787
runs-on: ${{ matrix.platform }}
8888
steps:
8989
- name: Checkout
90-
uses: actions/checkout@v3
90+
uses: actions/checkout@v4
9191
- name: Install dependencies
9292
if: matrix.packages != ''
9393
run: sudo apt-get -y install ${{ matrix.packages }}
@@ -98,7 +98,7 @@ jobs:
9898
- name: Cargo build
9999
run: cargo build --release --all-features --target ${{ matrix.target }} --bin ${{ env.CARGO_BIN_NAME }}
100100
- name: Upload artifacts
101-
uses: actions/upload-artifact@v3
101+
uses: actions/upload-artifact@v4
102102
with:
103103
name: ${{ matrix.name }}
104104
path: |
@@ -115,7 +115,7 @@ jobs:
115115
needs: [ build ]
116116
steps:
117117
- name: Download artifacts
118-
uses: actions/download-artifact@v3
118+
uses: actions/download-artifact@v4
119119
with:
120120
path: artifacts
121121
- name: Rename artifacts
@@ -127,6 +127,6 @@ jobs:
127127
done
128128
ls -R ../out
129129
- name: Release
130-
uses: softprops/action-gh-release@v1
130+
uses: softprops/action-gh-release@v2
131131
with:
132132
files: out/*

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
/target
1+
target/
22
Cargo.lock
33
.idea

Cargo.toml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
[package]
2-
name = "cwdemangle"
3-
version = "0.2.0"
4-
edition = "2018"
5-
authors = ["Luke Street <[email protected]>"]
6-
license = "MIT OR Apache-2.0"
7-
repository = "https://github.com/encounter/cwdemangle"
8-
readme = "README.md"
9-
description = """
10-
CodeWarrior C++ symbol demangler
11-
"""
12-
categories = ["command-line-utilities"]
13-
rust-version = "1.58"
14-
15-
[dependencies]
16-
argh = "0.1.8"
1+
[workspace]
2+
members = ["lib", "bin"]
3+
resolver = "2"

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,37 @@
1010

1111
A CodeWarrior C++ symbol demangler.
1212

13-
### Usage
13+
## Usage
1414

15-
CLI:
15+
### CLI
16+
17+
Static binaries available from [releases](https://github.com/encounter/cwdemangle/releases) or install via `cargo install cwdemangle-bin`.
1618

1719
```shell
1820
cwdemangle 'BuildLight__9CGuiLightCFv'
1921
```
2022

21-
Library:
23+
Pass `--help` to see available options.
24+
25+
### Library
26+
27+
- No dependencies
28+
- `#![no_std]` compatible (requires `alloc`)
29+
30+
Cargo.toml:
31+
32+
```toml
33+
[dependencies]
34+
cwdemangle = "0.2"
35+
```
36+
37+
Usage:
2238

2339
```rust
2440
use cwdemangle::{demangle, DemangleOptions};
2541

26-
if let Some(result) = demangle("BuildLight__9CGuiLightCFv", &DemangleOptions::default()) {
27-
println!("{}", result);
28-
} else {
29-
eprintln!("Couldn't demangle symbol (not a C++ symbol?)");
30-
}
42+
let result = demangle("BuildLight__9CGuiLightCFv", &DemangleOptions::default());
43+
assert_eq!(result, Some("CGuiLight::BuildLight() const".to_string()));
3144
```
3245

3346
### License

bin/Cargo.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "cwdemangle-bin"
3+
version = "1.0.0"
4+
edition = "2021"
5+
authors = ["Luke Street <[email protected]>"]
6+
license = "MIT OR Apache-2.0"
7+
repository = "https://github.com/encounter/cwdemangle"
8+
readme = "../README.md"
9+
description = "CodeWarrior C++ symbol demangler (binary)"
10+
categories = ["command-line-utilities"]
11+
rust-version = "1.58"
12+
13+
[[bin]]
14+
name = "cwdemangle"
15+
path = "src/main.rs"
16+
17+
[dependencies]
18+
argh = "0.1.12"
19+
cwdemangle = { path = "../lib" }
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)