generated from PlexSheep/rs-base
Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Christoph J. Scherr | 827efcee24 |
|
@ -0,0 +1,46 @@
|
||||||
|
name: cargo devel CI
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
|
# - '!master'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format:
|
||||||
|
name: cargo CI
|
||||||
|
permissions:
|
||||||
|
# Give the default GITHUB_TOKEN write permission to commit and push the
|
||||||
|
# added or changed files to the repository.
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: get repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: install rust
|
||||||
|
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||||
|
- name: install additional rust things
|
||||||
|
run: |
|
||||||
|
rustup component add rustfmt
|
||||||
|
rustup component add clippy
|
||||||
|
- name: config custom registry
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.cargo/
|
||||||
|
echo "" > ~/.cargo/config.toml
|
||||||
|
echo "[registry]" >> ~/.cargo/config.toml
|
||||||
|
echo 'cscherr = "cscherr"' >> ~/.cargo/config.toml
|
||||||
|
echo '[registries.cscherr]' >> ~/.cargo/config.toml
|
||||||
|
echo 'index = "https://git.cscherr.de/PlexSheep/_cargo-index.git"' >> ~/.cargo/config.toml
|
||||||
|
cat ~/.cargo/config.toml
|
||||||
|
- name: cargo clippy check
|
||||||
|
run: cargo clippy --all-features --all-targets --workspace
|
||||||
|
- name: cargo clippy fix
|
||||||
|
run: cargo clippy --fix --all-features --all-targets --workspace
|
||||||
|
- name: cargo fmt
|
||||||
|
run: cargo fmt --all
|
||||||
|
- name: cargo test
|
||||||
|
run: cargo test --all-features --all-targets --workspace && cargo test --all-features --workspace --doc
|
||||||
|
- name: commit back to repository
|
||||||
|
uses: https://github.com/stefanzweifel/git-auto-commit-action@v5
|
||||||
|
with:
|
||||||
|
# Optional. Commit message for the created commit.
|
||||||
|
# Defaults to "Apply automatic changes"
|
||||||
|
commit_message: automatic cargo CI changes
|
|
@ -1,7 +0,0 @@
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
# Check for updates every Monday
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
|
@ -1,16 +1,10 @@
|
||||||
name: Rust CI
|
name: cargo devel CI
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- '**'
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- '**'
|
||||||
# - '!master'
|
# - '!master'
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
CI:
|
CI:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -44,10 +38,10 @@ jobs:
|
||||||
- name: cargo fmt
|
- name: cargo fmt
|
||||||
run: cargo fmt --all
|
run: cargo fmt --all
|
||||||
- name: cargo test
|
- name: cargo test
|
||||||
run: cargo test --all-features --all-targets --workspace
|
run: cargo test --all-features --all-targets --workspace && cargo test --all-features --workspace --doc
|
||||||
- name: commit back to repository
|
- name: commit back to repository
|
||||||
uses: stefanzweifel/git-auto-commit-action@v5
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
# Optional. Commit message for the created commit.
|
# Optional. Commit message for the created commit.
|
||||||
# Defaults to "Apply automatic changes"
|
# Defaults to "Apply automatic changes"
|
||||||
commit_message: "ci: automatic Rust CI changes"
|
commit_message: automatic cargo CI changes
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
name: Release-plz
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
# Release unpublished packages.
|
|
||||||
release-plz-release:
|
|
||||||
name: Release-plz release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
- name: Run release-plz
|
|
||||||
uses: MarcoIeni/release-plz-action@v0.5
|
|
||||||
with:
|
|
||||||
command: release
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
# Create a PR with the new versions and changelog, preparing the next release.
|
|
||||||
release-plz-pr:
|
|
||||||
name: Release-plz PR
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
concurrency:
|
|
||||||
group: release-plz-${{ github.ref }}
|
|
||||||
cancel-in-progress: false
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
- name: Run release-plz
|
|
||||||
uses: MarcoIeni/release-plz-action@v0.5
|
|
||||||
with:
|
|
||||||
command: release-pr
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
32
README.md
32
README.md
|
@ -1,12 +1,15 @@
|
||||||
# numf
|
# numf
|
||||||
|
|
||||||
|
|
||||||
![Project badge](https://img.shields.io/badge/language-Rust-blue.svg)
|
![Project badge](https://img.shields.io/badge/language-Rust-blue.svg)
|
||||||
![Crates.io License](https://img.shields.io/crates/l/numf)
|
![Crates.io License](https://img.shields.io/crates/l/numf)
|
||||||
![GitHub Release](https://img.shields.io/github/v/release/PlexSheep/numf)
|
![Gitea Release](https://img.shields.io/gitea/v/release/PlexSheep/numf?gitea_url=https%3A%2F%2Fgit.cscherr.de)
|
||||||
![GitHub language count](https://img.shields.io/github/languages/count/PlexSheep/numf)
|
![Gitea language count](https://img.shields.io/gitea/languages/count/PlexSheep/numf?gitea_url=https%3A%2F%2Fgit.cscherr.de)
|
||||||
[![Rust CI](https://github.com/PlexSheep/numf/actions/workflows/cargo.yaml/badge.svg)](https://github.com/PlexSheep/numf/actions/workflows/cargo.yaml)
|
[![cargo checks and tests](https://github.com/PlexSheep/numf/actions/workflows/cargo.yaml/badge.svg)](https://github.com/PlexSheep/numf/actions/workflows/cargo.yaml)
|
||||||
|
|
||||||
* [GitHub](https://github.com/PlexSheep/numf)
|
* [Original Repository](https://git.cscherr.de/PlexSheep/numf)
|
||||||
|
* [GitHub Mirror](https://github.com/PlexSheep/numf)
|
||||||
|
* [Codeberg Mirror](https://codeberg.org/PlexSheep/numf)
|
||||||
* [crates.io](https://crates.io/crates/numf)
|
* [crates.io](https://crates.io/crates/numf)
|
||||||
* [docs.rs](https://docs.rs/numf/latest/numf/)
|
* [docs.rs](https://docs.rs/numf/latest/numf/)
|
||||||
|
|
||||||
|
@ -33,27 +36,6 @@ $ numf -xp 1337 505 0xaabb
|
||||||
0x539
|
0x539
|
||||||
0x1F9
|
0x1F9
|
||||||
0xAABB
|
0xAABB
|
||||||
$ numf -a 505 | hedxump -C
|
|
||||||
00000000 01 f9 |..|
|
|
||||||
00000002
|
|
||||||
$ numf -a 505 | numf
|
|
||||||
1F9
|
|
||||||
$ numf -a 505 | numf -d
|
|
||||||
505
|
|
||||||
$ numf -a 505 | numf -b
|
|
||||||
111111001
|
|
||||||
$ echo -ne "\x20\xff\xb4" | numf -xpP
|
|
||||||
0x20FFB4
|
|
||||||
$ echo -ne "\x20\xff\xb4" | numf -d
|
|
||||||
2162612
|
|
||||||
$ base64='aGVsbG8gd29ybGQuCg==' ; echo "0s$base64" | numf -d
|
|
||||||
8271117963529473544792763018762
|
|
||||||
$ base64='aGVsbG8gd29ybGQuCg==' ; echo "0s$base64" | numf -s
|
|
||||||
aGVsbG8gd29ybGQuCg==
|
|
||||||
$ echo "0b100100101010" | numf -d
|
|
||||||
2346
|
|
||||||
$ echo "0b100100101010" | numf -bPp
|
|
||||||
0b0000100100101010
|
|
||||||
```
|
```
|
||||||
## Installing
|
## Installing
|
||||||
|
|
||||||
|
|
|
@ -93,20 +93,12 @@ impl Display for Format {
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Parser, Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Parser, Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
#[clap(author, version, about, long_about = None)]
|
|
||||||
#[command(
|
#[command(
|
||||||
author,
|
author,
|
||||||
version,
|
version,
|
||||||
about,
|
about,
|
||||||
long_about,
|
long_about,
|
||||||
help_template = r#"{about-section}
|
help_template = libpt::cli::args::HELP_TEMPLATE)]
|
||||||
{usage-heading} {usage}
|
|
||||||
{all-args}{tab}
|
|
||||||
|
|
||||||
{name}: {version}
|
|
||||||
Author: {author-with-newline}
|
|
||||||
"#
|
|
||||||
)]
|
|
||||||
#[clap(group(
|
#[clap(group(
|
||||||
ArgGroup::new("format")
|
ArgGroup::new("format")
|
||||||
.args(&["hex", "bin", "oct", "dec", "base64", "base32", "raw"]),
|
.args(&["hex", "bin", "oct", "dec", "base64", "base32", "raw"]),
|
||||||
|
|
Reference in New Issue