summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsitkevij <1553398+sitkevij@users.noreply.github.com>2023-09-23 09:42:01 -0700
committersitkevij <1553398+sitkevij@users.noreply.github.com>2023-09-23 09:42:01 -0700
commit14910a007ac92472b33bd6750121e8997c92968a (patch)
treee7c8a70938fa9f54f1de61035fb63ed82260dd74
parent2349e7fe145a1ab73ad91fb7535ec645389c889a (diff)
chore: remove lib ref in main, add dev tools, update .gitignore
-rw-r--r--.gitignore1
-rw-r--r--Makefile3
-rw-r--r--src/main.rs37
3 files changed, 22 insertions, 19 deletions
diff --git a/.gitignore b/.gitignore
index 91a6361..12ea79c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@
**/*.rs.bk
.DS_Store
+.vscode
# ci code coverage
tarpaulin-report.html
diff --git a/Makefile b/Makefile
index bbef150..ff24af1 100644
--- a/Makefile
+++ b/Makefile
@@ -42,6 +42,9 @@ cargo-install-tools:
cargo install cargo-edit
cargo install --list
+python-install-tools:
+ pip install codespell
+
publish-dry-run:
cargo publish --dry-run
cargo package --list
diff --git a/src/main.rs b/src/main.rs
index 81313f0..176732b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,7 +1,6 @@
extern crate clap;
-mod lib;
+
use clap::{App, Arg};
-use lib::{ARG_ARR, ARG_CLR, ARG_COL, ARG_FMT, ARG_FNC, ARG_INP, ARG_LEN, ARG_PLC};
use std::env;
use std::io::Error;
use std::io::ErrorKind;
@@ -18,71 +17,71 @@ fn main() {
.version(env!("CARGO_PKG_VERSION"))
.about(desc)
.arg(
- Arg::with_name(ARG_COL)
+ Arg::with_name(hx::ARG_COL)
.short("c")
- .long(ARG_COL)
+ .long(hx::ARG_COL)
.value_name("columns")
.help("Set column length")
.takes_value(true),
)
.arg(
- Arg::with_name(ARG_LEN)
+ Arg::with_name(hx::ARG_LEN)
.short("l")
- .long(ARG_LEN)
- .value_name(ARG_LEN)
+ .long(hx::ARG_LEN)
+ .value_name(hx::ARG_LEN)
.help("Set <len> bytes to read")
.takes_value(true),
)
.arg(
- Arg::with_name(ARG_FMT)
+ Arg::with_name(hx::ARG_FMT)
.short("f")
- .long(ARG_FMT)
+ .long(hx::ARG_FMT)
.help("Set format of octet: Octal (o), LowerHex (x), UpperHex (X), Binary (b)")
.possible_values(&["o", "x", "X", "b"])
.takes_value(true),
)
.arg(
- Arg::with_name(ARG_INP)
+ Arg::with_name(hx::ARG_INP)
.help("Pass file path as an argument for hex dump")
.required(false)
.index(1),
)
.arg(
- Arg::with_name(ARG_CLR)
+ Arg::with_name(hx::ARG_CLR)
.short("t")
- .long(ARG_CLR)
+ .long(hx::ARG_CLR)
.help("Set color tint terminal output. 0 to disable, 1 to enable")
.possible_values(&["0", "1"])
.takes_value(true),
)
.arg(
- Arg::with_name(ARG_ARR)
+ Arg::with_name(hx::ARG_ARR)
.short("a")
- .long(ARG_ARR)
+ .long(hx::ARG_ARR)
.value_name("array_format")
.help("Set source code format output: rust (r), C (c), golang (g), python (p), kotlin (k), java (j), swift (s), fsharp (f)")
.possible_values(&["r", "c", "g", "p", "k", "j", "s", "f"])
.takes_value(true),
)
.arg(
- Arg::with_name(ARG_FNC)
+ Arg::with_name(hx::ARG_FNC)
.short("u")
- .long(ARG_FNC)
+ .long(hx::ARG_FNC)
.value_name("func_length")
.help("Set function wave length")
.takes_value(true),
)
.arg(
- Arg::with_name(ARG_PLC)
+ Arg::with_name(hx::ARG_PLC)
.short("p")
- .long(ARG_PLC)
+ .long(hx::ARG_PLC)
.value_name("func_places")
.help("Set function wave output decimal places")
.takes_value(true),
);
let matches = app.get_matches();
- match lib::run(matches) {
+ match hx::run(matches) {
Ok(_) => {
process::exit(0);
}