From 83250589fbfddf2a22fbfdf0210f8ddd10407d13 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Mon, 13 May 2024 17:07:22 +0200 Subject: [PATCH 1/7] chore: remove unused dep clap-num and disable default features for libpt --- Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b0c7617..44e2f09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,8 +16,7 @@ categories = ["command-line-utilities", "encoding"] [dependencies] anyhow = "1.0.83" clap = { version = "4.5.4", features = ["derive"] } -clap-num = "1.1.1" fast32 = "1.0.2" -libpt = { version = "0.5.1", features = ["bintols"]} +libpt = { version = "0.5.1", features = ["bintols"], default-features = false } num = "0.4.3" From 9c9b476b22dcfb733028be7c5f8549e09be994a4 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Mon, 13 May 2024 17:13:33 +0200 Subject: [PATCH 2/7] docs: fix --help formatting --- src/format.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/format.rs b/src/format.rs index 1534b33..d4fdaec 100644 --- a/src/format.rs +++ b/src/format.rs @@ -76,13 +76,17 @@ pub struct FormatOptions { /// /// Formats: /// - /// - '0x' - Hexadecimal - /// - '0b' - Binary - /// - '0o' - Octal - /// - '0s' - Base64 - /// - '032s' - Base32 + /// * '0x' - Hexadecimal /// - /// The numbers may be left empty at first, if numbers are provided with the stdin. + /// * '0b' - Binary + /// + /// * '0o' - Octal + /// + /// * '0s' - Base64 + /// + /// * '032s' - Base32 + /// + /// The numbers may be left empty at first, if numbers are provided from the stdin. numbers: Vec, } From 0520032ab54d625450ef89aa638c21f493ae5bed Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Mon, 13 May 2024 17:14:47 +0200 Subject: [PATCH 3/7] docs: add some info to the readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 68d0887..9435e43 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ Current formats are: - Base64 `numf` also has the option of prepending a prefix for each format, such as -`0x` for hexadecimal. +`0x` for hexadecimal. Numbers may also be provided from the stdin. See `--help` +flag for more information. ## Example From f4b8927a6a64a91c86e9ff93a502caebc44bffb6 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Thu, 16 May 2024 17:32:45 +0200 Subject: [PATCH 4/7] docs(help): change formulation for numbers --- src/format.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/format.rs b/src/format.rs index d4fdaec..ca05e04 100644 --- a/src/format.rs +++ b/src/format.rs @@ -69,7 +69,7 @@ pub struct FormatOptions { /// format to base32 base32: bool, #[clap(value_parser=numf_parser::, required=false)] - /// at least one number that should be formatted + /// numbers that should be formatted /// /// Any of the [Formats](Format::format) are supported, but the prefixes are needed for formats /// other than decimal. From 1a87391d5eaa6c66b859043e6f6b24634e648282 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Thu, 16 May 2024 17:46:25 +0200 Subject: [PATCH 5/7] docs(readme): add fancy badges and mirror links Refs: #6 --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9435e43..3b780e5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,18 @@ # numf + +![Project badge](https://img.shields.io/badge/language-Rust-blue.svg) +![Crates.io License](https://img.shields.io/crates/l/numf) +![Gitea Release](https://img.shields.io/gitea/v/release/PlexSheep/numf?gitea_url=https%3A%2F%2Fgit.cscherr.de) +![Gitea language count](https://img.shields.io/gitea/languages/count/PlexSheep/numf?gitea_url=https%3A%2F%2Fgit.cscherr.de) +[![cargo checks and tests](https://github.com/PlexSheep/numf/actions/workflows/cargo.yaml/badge.svg)](https://github.com/PlexSheep/numf/actions/workflows/cargo.yaml) + +* [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) +* [docs.rs](https://docs.rs/crate/numf/) + `numf` is a number formatter. It formats the numbers provided to it. Current formats are: @@ -11,7 +24,7 @@ Current formats are: - Base32 - Base64 -`numf` also has the option of prepending a prefix for each format, such as +`numf` also has the onumfion of prepending a prefix for each format, such as `0x` for hexadecimal. Numbers may also be provided from the stdin. See `--help` flag for more information. From eba7d2fe016a35e68586132748fcbeb12454cd60 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Thu, 16 May 2024 17:50:19 +0200 Subject: [PATCH 6/7] docs(readme): change docs.rs link to the documentation instead of the crate --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b780e5..724ee76 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ * [GitHub Mirror](https://github.com/PlexSheep/numf) * [Codeberg Mirror](https://codeberg.org/PlexSheep/numf) * [crates.io](https://crates.io/crates/numf) -* [docs.rs](https://docs.rs/crate/numf/) +* [docs.rs](https://docs.rs/numf/latest/numf/) `numf` is a number formatter. It formats the numbers provided to it. From bc07eb5c978d47745e32e809a75b9b198ef7b892 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Thu, 16 May 2024 17:50:57 +0200 Subject: [PATCH 7/7] refactor: remove the scripts directory --- scripts/publish.sh | 11 ----------- scripts/release.sh | 24 ------------------------ 2 files changed, 35 deletions(-) delete mode 100755 scripts/publish.sh delete mode 100755 scripts/release.sh diff --git a/scripts/publish.sh b/scripts/publish.sh deleted file mode 100755 index 4a3d17d..0000000 --- a/scripts/publish.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -e -cargo check --all-features -echo ">>>>>>>> PUBLISHING RELEASE FOR REPO" -bash scripts/release.sh -echo ">>>>>>>> PUBLISHING TO CRATES.IO NEXT" -sleep 2 -cargo publish -echo ">>>>>>>> PUBLISHING TO CSCHERR.DE NEXT" -sleep 2 -cargo publish --registry cscherr diff --git a/scripts/release.sh b/scripts/release.sh deleted file mode 100755 index 275ed55..0000000 --- a/scripts/release.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -TOKEN=$(cat ~/.git-credentials | grep 'git.cscherr.de' | grep -P '(?:)[^:]*(?=@)' -o) -NEW_VERSION=$(cat Cargo.toml | rg '^\s*version\s*=\s*"([^"]*)"\s*$' -or '$1') -GIT_COMMIT_SHA=$(git rev-parse HEAD) -REPO=${PWD##*/} # name of cwd -BODY=" -$(git log $(git describe --tags --abbrev=0)..HEAD --pretty="- %s" --oneline --decorate) -" -USER=PlexSheep -git tag "v$NEW_VERSION" || echo "could not tag" -curl -X 'POST' \ - 'https://git.cscherr.de/api/v1/repos/PlexSheep/'$REPO'/releases' \ - -H 'accept: application/json' \ - -H "Authorization: token $TOKEN" \ - -H 'Content-Type: application/json' \ - -d '{ - "body": "'"$BODY"'", - "draft": false, - "name": "v'$NEW_VERSION'", - "prerelease": true, - "tag_name": "v'$NEW_VERSION'", - "target_commitish": "'$GIT_COMMIT_SHA'" -}' | python -m json.tool -git push || echo "could not push"