kwh-calc renamed to more suitable name kwh-cost.
This commit is contained in:
parent
25311a3b7e
commit
e61890310f
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
|||||||
*.o
|
*.o
|
||||||
kwh-calc
|
kwh-cost
|
||||||
.vscode
|
.vscode
|
6
Makefile
6
Makefile
@ -1,4 +1,4 @@
|
|||||||
TARGET=kwh-calc
|
TARGET=kwh-cost
|
||||||
|
|
||||||
CFLAGS=--std=c2x -O3 -Wall -Werror -Wextra -pedantic
|
CFLAGS=--std=c2x -O3 -Wall -Werror -Wextra -pedantic
|
||||||
|
|
||||||
@ -22,8 +22,8 @@ clean:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
install -Dm755 ${TARGET} ${DESTDIR}usr/bin/${TARGET}
|
install -Dm755 ${TARGET} ${DESTDIR}usr/bin/${TARGET}
|
||||||
install -Dm644 LICENSE ${DESTDIR}usr/share/licenses/kwh-calc/LICENSE
|
install -Dm644 LICENSE ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f ${DESTDIR}usr/bin/${TARGET}
|
rm -f ${DESTDIR}usr/bin/${TARGET}
|
||||||
rm -f ${DESTDIR}usr/share/licenses/kwh-calc/LICENSE
|
rm -f ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE
|
6
PKGBUILD
6
PKGBUILD
@ -1,13 +1,13 @@
|
|||||||
# Maintainer: Alexander "Arav" Andreev <me@arav.top>
|
# Maintainer: Alexander "Arav" Andreev <me@arav.top>
|
||||||
pkgname=kwh-calc
|
pkgname=kwh-cost
|
||||||
pkgver=1.0.0
|
pkgver=1.0.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
epoch=0
|
epoch=0
|
||||||
pkgdesc="Calculate cost of electricity."
|
pkgdesc="Calculate cost of electricity."
|
||||||
arch=('any')
|
arch=('any')
|
||||||
url="https://git.arav.top/Arav/kwh-calc"
|
url="https://git.arav.top/Arav/kwh-cost"
|
||||||
license=('MIT')
|
license=('MIT')
|
||||||
source=('git+https://git.arav.top/Arav/kwh-calc.git')
|
source=('git+https://git.arav.top/Arav/kwh-cost.git')
|
||||||
md5sums=('SKIP')
|
md5sums=('SKIP')
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
10
README.md
10
README.md
@ -1,11 +1,11 @@
|
|||||||
# kwh-calc
|
# kwh-cost
|
||||||
|
|
||||||
Calculate cost of electricity.
|
Calculate cost of electricity.
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ kwh-calc [OPTIONS] price wattage interval [interval ..]
|
$ kwh-cost [OPTIONS] price wattage interval [interval ..]
|
||||||
```
|
```
|
||||||
|
|
||||||
Options are -v, --version to show program's version; and -h, --help to show usage of a program.
|
Options are -v, --version to show program's version; and -h, --help to show usage of a program.
|
||||||
@ -18,7 +18,7 @@ Options are -v, --version to show program's version; and -h, --help to show usag
|
|||||||
Here is an example:
|
Here is an example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ kwh-calc 3.68 120 30d 2h
|
$ kwh-cost 3.68 120 30d 2h
|
||||||
```
|
```
|
||||||
|
|
||||||
P.S.: Yeah, I pay 3.68 rubles per kWh. Which is just $0.05. :)
|
P.S.: Yeah, I pay 3.68 rubles per kWh. Which is just $0.05. :)
|
||||||
@ -27,8 +27,8 @@ P.S.: Yeah, I pay 3.68 rubles per kWh. Which is just $0.05. :)
|
|||||||
|
|
||||||
### Manually
|
### Manually
|
||||||
|
|
||||||
First run `make` to build a program, and then `make install` to copy executable in `/usr/bin/`. Later, use `make uninstall` to delete it, or just delete `/usr/bin/kwh-calc`.
|
First run `make` to build a program, and then `make install` to copy executable in `/usr/bin/`. Later, use `make uninstall` to delete it, or just delete `/usr/bin/kwh-cost`.
|
||||||
|
|
||||||
### For ArchLinux
|
### For ArchLinux
|
||||||
|
|
||||||
You can take a [PKGBUILD](/Arav/kwh-calc/raw/branch/master/PKGBUILD) file and in a directory with it run `makepkg -i`.
|
You can take a [PKGBUILD](/Arav/kwh-cost/raw/branch/master/PKGBUILD) file and in a directory with it run `makepkg -i`.
|
@ -75,13 +75,13 @@ inline price_t to_wattpersecond(price_t price) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void print_version() {
|
void print_version() {
|
||||||
puts("kwh-calc Ver. " VERSION "\n"
|
puts("kwh-cost Ver. " VERSION "\n"
|
||||||
"Copyright (C) 2021 Alexander \"Arav\" Andreev <me@arav.top>. All rights reserved.\n"
|
"Copyright (C) 2021 Alexander \"Arav\" Andreev <me@arav.top>. All rights reserved.\n"
|
||||||
"License for this program is stored in /usr/share/licenses/kwh-calc/LICENSE.");
|
"License for this program is stored in /usr/share/licenses/kwh-cost/LICENSE.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_usage() {
|
void print_usage() {
|
||||||
puts("Usage: kwh-calc [options] price wattage interval [interval ...]\n"
|
puts("Usage: kwh-cost [options] price wattage interval [interval ...]\n"
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
" --help, -h Display this usage information.\n"
|
" --help, -h Display this usage information.\n"
|
||||||
" --version, -v Display program version.\n"
|
" --version, -v Display program version.\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user