diff options
author | sitkevij <1553398+sitkevij@users.noreply.github.com> | 2023-09-29 15:39:34 -0700 |
---|---|---|
committer | sitkevij <1553398+sitkevij@users.noreply.github.com> | 2023-09-29 15:39:34 -0700 |
commit | 82ad53f5e4a3b0ea3e42b15d0d24cc27e8b5cd7b (patch) | |
tree | f98ede5b3d69e7fca4d8500a3e0ec8d0b9431952 | |
parent | fcbe0653d9e5eb1b6e28ffb840c6a05dc8655c59 (diff) |
docs: readme update, markdown lint config
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .markdownlint.yaml | 29 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | MANPAGE.md | 13 | ||||
-rw-r--r-- | README.md | 42 | ||||
-rw-r--r-- | hx.1 | 8 | ||||
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | tests/files/lorem.md | 3 |
8 files changed, 74 insertions, 26 deletions
@@ -11,6 +11,7 @@ .DS_Store .vscode +*.ignore.* # ci code coverage tarpaulin-report.html diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..300857e --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,29 @@ +# MD013/line-length - Line length +MD013: + # Number of characters + line_length: 100 + # Number of characters for headings + heading_line_length: 100 + # Number of characters for code blocks + code_block_line_length: 100 + # Include code blocks + code_blocks: false + # Include tables + tables: false + # Include headings + headings: true + # Include headings + headers: true + # Strict length checking + strict: false + # Stern length checking + stern: false + +# set for man page markdown +MD025: false +# MD025/single-title/single-h1 - Multiple top-level headings in the same document +# MD025: +# # Heading level +# level: 1 +# # RegExp for matching title in front matter +# front_matter_title: "^\\s*title\\s*[:=]" @@ -1,7 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - [[package]] name = "ansi_term" version = "0.11.0" @@ -6,7 +6,7 @@ ```txt hx [-tcfl][--color=0,1][--cols 0-9][--format oxXb] inputfile -hx [-a rcgpkjsf][ --array=rcgpkjsf] inputfile +hx [-a rcgpkjsf][--array=rcgpkjsf] inputfile hx [-up][--func 0-9][--places 0-9] hx [-hV] ``` @@ -14,8 +14,12 @@ hx [-hV] # OPTIONS ```txt +hx +Futuristic take on hexdump, made in Rust. + USAGE: hx [OPTIONS] [INPUTFILE] + <stdin> hx [OPTIONS] FLAGS: -h, --help Prints help information @@ -34,7 +38,6 @@ OPTIONS: ARGS: <INPUTFILE> Pass file path as an argument, or input data may be passed via stdin - ``` # DESCRIPTION @@ -51,7 +54,7 @@ The **NO_COLOR** environment variable is honored if set. # EXAMPLES -**hx** with file path as input, outputting colorized hexadecimal. +**hx** with file path as input, outputting colorized hexadecimal: ```sh $ hx tests/files/alphanumeric.txt @@ -65,10 +68,10 @@ $ hx tests/files/alphanumeric.txt bytes: 68 ``` -**hx** with stdin as input, outputting colorized hexadecimal. +**hx** with stdin as input, outputting colorized hexadecimal: ```sh -$ cat "tests/files/alphanumeric.txt" | hx +$ cat tests/files/alphanumeric.txt | hx 0x000000: 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a abcdefghij 0x00000a: 0x6b 0x69 0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 kilmnopqrs 0x000014: 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x30 0x31 0x32 tuvwxyz012 @@ -2,7 +2,10 @@ Futuristic take on hexdump. -[hx](https://github.com/sitkevij/hex) accepts a file path as input and outputs a hexadecimal colorized view to stdout. +[hx](https://github.com/sitkevij/hex) accepts a file path or stdin as input and outputs +a hexadecimal colorized view to stdout. + +[hx](https://github.com/sitkevij/hex) with file path as input, outputting colorized hexadecimal: ```sh $ hx tests/files/alphanumeric.txt @@ -16,10 +19,10 @@ $ hx tests/files/alphanumeric.txt bytes: 68 ``` -[hx](https://github.com/sitkevij/hex) also accepts stdin as input. +[hx](https://github.com/sitkevij/hex) with stdin as input, outputting colorized hexadecimal: ```sh -cat "tests/files/alphanumeric.txt" | hx +cat tests/files/alphanumeric.txt | hx 0x000000: 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a abcdefghij 0x00000a: 0x6b 0x69 0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 kilmnopqrs 0x000014: 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x30 0x31 0x32 tuvwxyz012 @@ -35,10 +38,11 @@ cat "tests/files/alphanumeric.txt" | hx ## quick links -* [install](#install) -* [features](#features) -* [manual](#manual) -* [license](#license) +- [examples](#examples) +- [installation](#installation) +- [features](#features) +- [help](#help) +- [license](#license) ## examples @@ -60,7 +64,13 @@ cat "tests/files/alphanumeric.txt" | hx ![octal hex output format](https://raw.githubusercontent.com/sitkevij/hex/master/assets/hex_screenshot_macos_format_o.png) -## install +## installation + +### packaging availability + +`hx` is packaged and available for install on the following platforms: + +[![Packaging status](https://repology.org/badge/vertical-allrepos/hx-hexdump.svg)](https://repology.org/project/hx-hexdump/versions) ### crates.io install @@ -88,7 +98,8 @@ cargo install --path . Which will compile the release version, run tests and install release binary to `<USERDIR>/.cargo/bin/hx`. -If `<USERDIR>/.cargo/bin` is part of the `PATH` environment variable, `hx` should be able to be executed anywhere in the shell. +If `<USERDIR>/.cargo/bin` is part of the `PATH` environment variable, `hx` should be able +executable anywhere in the shell. ### arch linux install @@ -122,7 +133,7 @@ cat README.md | docker run -i sitkevij/hx:latest ## features -### output arrays in `rust`, `c`, `golang`, `python`, `kotlin`, `java`, or `swift` +### output arrays in `rust`, `c`, `golang`, `python`, `fsharp`, `kotlin`, `java`, or `swift` `hx` has a feature which can output the input file bytes as source code arrays. @@ -206,10 +217,10 @@ let a = [| Rust `no_color` crate: -* <https://crates.io/crates/no_color> -* <https://github.com/sitkevij/no_color> +- <https://crates.io/crates/no_color> +- <https://github.com/sitkevij/no_color> -## manual +## help ```txt hx @@ -224,7 +235,8 @@ FLAGS: -V, --version Prints version information OPTIONS: - -a, --array <array_format> Set source code format output: rust (r), C (c), golang (g), python (p), kotlin (k), java (j) [possible values: r, c, g, p, k, j] + -a, --array <array_format> 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] -t, --color <color> Set color tint terminal output. 0 to disable, 1 to enable [possible values: 0, 1] -c, --cols <columns> Set column length -f, --format <format> Set format of octet: Octal (o), LowerHex (x), UpperHex (X), Binary (b) [possible @@ -234,7 +246,7 @@ OPTIONS: -p, --places <func_places> Set function wave output decimal places ARGS: - <INPUTFILE> Pass file path as an argument for hex dump + <INPUTFILE> Pass file path as an argument, or input data may be passed via stdin ``` ## license @@ -7,15 +7,19 @@ .IP .EX hx [-tcfl][--color=0,1][--cols 0-9][--format oxXb] inputfile -hx [-a rcgpkjsf][ --array=rcgpkjsf] inputfile +hx [-a rcgpkjsf][--array=rcgpkjsf] inputfile hx [-up][--func 0-9][--places 0-9] hx [-hV] .EE .SH OPTIONS .IP .EX +hx +Futuristic take on hexdump, made in Rust. + USAGE: hx [OPTIONS] [INPUTFILE] + <stdin> hx [OPTIONS] FLAGS: -h, --help Prints help information @@ -62,7 +66,7 @@ $ hx tests/files/alphanumeric.txt \f[B]hx\f[R] with stdin as input, outputting colorized hexadecimal. .IP .EX -$ cat \[dq]tests/files/alphanumeric.txt\[dq] | hx +$ cat tests/files/alphanumeric.txt | hx 0x000000: 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a abcdefghij 0x00000a: 0x6b 0x69 0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 kilmnopqrs 0x000014: 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x30 0x31 0x32 tuvwxyz012 @@ -57,7 +57,7 @@ const DBG: u8 = 0x0; /// b ⇒ Binary /// e ⇒ LowerExp /// E ⇒ UpperExp -/// evaulate for traits implementation +/// evaluate for traits implementation #[derive(Copy, Clone, Debug)] pub enum Format { /// octal format diff --git a/tests/files/lorem.md b/tests/files/lorem.md index 69f6d93..a35e76d 100644 --- a/tests/files/lorem.md +++ b/tests/files/lorem.md @@ -1,3 +1,4 @@ # Lorem Ipsum -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore +et dolore magna aliqua. |