Skip to content

Commit

Permalink
Merge pull request #23 from Reokodoku/doc-update
Browse files Browse the repository at this point in the history
Update documentation
  • Loading branch information
Arnau478 authored May 12, 2024
2 parents 9bd92a7 + f74303a commit 27a3023
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ The command should be used as `hevi <file> [flags]`. The flags are described [be
| -------------------------------- | ------------------------------------------------------- |
| `-h`/`--help` | Show a help message |
| `-v`/`--version` | Show version information |
| `--color`/`--no-color` | Enable and disable colored output |
| `--color`/`--no-color` | Enable or disable colored output |
| `--lowercase`/`--uppercase` | Toggle between lowercase and uppercase hex |
| `--size`/`--no-size` | Enable and disable the line showing the size at the end |
| `--offset`/`--no-offset` | Enable and disable showing the offset |
| `--acii`/`--no-ascii` | Enable and disable ASCII interpretation |
| `--skip-lines`/`--no-skip-lines` | Enable and disable skipping of identical lines |
| `--size`/`--no-size` | Enable or disable the line showing the size at the end |
| `--offset`/`--no-offset` | Enable or disable showing the offset |
| `--ascii`/`--no-ascii` | Enable or disable ASCII interpretation |
| `--skip-lines`/`--no-skip-lines` | Enable or disable skipping of identical lines |
| `--parser` | Specify the parser to use. For a list use `hevi --help` |

### Environment variables
Expand All @@ -39,6 +39,7 @@ You can create a config file and specify the default values for the flags. It fo
.show_offset = true,
.show_ascii = false,
.skip_lines = true,
.parser = "data",
}
```

Expand Down
66 changes: 66 additions & 0 deletions doc/hevi.1.man
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.TH HEVI 1 2024-05-12 "hevi 1.0.0-dev"
.SH NAME
hevi \- a hex viewer

.SH SYNOPSIS
hevi [\fIOPTION\fR]... \fBFILE\fR

.SH DESCRIPTION
hevi is a hex viewer that focuses on modularity, simplicity and appearance.

.SH OPTIONS
.TP
\fB\-\-ascii\fR, \fB\-\-no\-ascii\fR
enable or disable ASCII interpretation

.TP
\fB\-\-color\fR, \fB\-\-no\-color\fR
enable or disable color support

.TP
\fB\-\-lowercase\fR, \fB\-\-uppercase\fR
toggle between lowercase and uppercase hex

.TP
\fB\-\-offset\fR, \fB\-\-no\-offset\fR
enable or disable showing the offset

.TP
\fB\-\-size\fR, \fB\-\-no\-size\fR
enable or disable the line showing at the end the size of the file

.TP
\fB\-\-skip\-lines\fR, \fB\-\-no\-skip\-lines\fR
enable or disable skipping of identical lines

.TP
\fB\-\-parser\fR=\fIPARSER\fR
specify the parser to use. For a list of available parsers type
.in +4
`hevi \-\-help`
.in

.TP
\fB\-h\fR, \fB\-\-help\fR
display a help message and exit

.TP
\fB\-v\fR, \fB\-\-version\fR
output version information and exit

.SH FILES
.TP
.I \[ti]/.config/hevi/config.zon
The main configuration file. See also
.BR hevi (5)

.SH ENVIRONMENT VARIABLES
.TP
.I NO_COLOR
If set with anything disables color. For more information go to https://no-color.org/

.SH REPORTING BUGS
Report bugs to https://github.com/Arnau478/hevi/issues

.SH SEE ALSO
.BR hevi (5)
57 changes: 57 additions & 0 deletions doc/hevi.5.man
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.TH HEVI 5 2024-05-12 "hevi 1.0.0-dev"
.SH NAME
hevi configuration file

.SH SYNOPSIS
.I ~/.config/hevi/config.zon

.SH DESCRIPTION
This page explains how the configuration file is structured and what its fields are.

The configuration file is a zon file, a sort of zig anonymous struct.

These are the fields of the configuration file:
.in +4
.nf
color = \fItrue\fR|\fIfalse\fR
uppercase = \fItrue\fR|\fIfalse\fR
show_size = \fItrue\fR|\fIfalse\fR
show_offset = \fItrue\fR|\fIfalse\fR
show_ascii = \fItrue\fR|\fIfalse\fR
show_lines = \fItrue\fR|\fIfalse\fR
parser = "\fIspecific parser\fR"
.fi
.in

You can also not put all the fields in the file, default values will be chosen.

The config file is located at:
.in +4
.nf
\fBLinux\fR, \fBMacOS\fR, \fBFreeBSD\fR, \fBOpenBSD\fR, \fBNetBSD\fR --> \fI$XDG_CONFIG_HOME/hevi/config.zon\fR or if the env doesn't exist \fI$HOME/.config/hevi/config.zon\fR
\fBWindows\fR --> \fI%APPDATA%/hevi/config.zon\fR
\fBOther\fR --> Not supported. No config file will be read.
.in

.SH EXAMPLES
.in +4
.EX
\%.{
.color = true,
.skip_lines = false,
.parser = "data",
}
.EE
.in

.SH NOTES
hevi has a precedence for configuration and is:
.nf
1. Flags
2. Environment variables
3. Config file
4. Defaults
.in

.SH SEE ALSO
.BR hevi (1)

0 comments on commit 27a3023

Please sign in to comment.