Skip to content

Commit

Permalink
Add manpage (#625)
Browse files Browse the repository at this point in the history
* Manpage: add initial manpage template

* CMake: integrate manpage installation to CMake

* Manpage: add details about JSONC based config files

* Manpage: minor cleanups

* Manpage: fix --print-structure

* Manpage: fix --structure

* help: change load-config -> config

* Manpage: remove legacy config file description

* Manpage: remove --print-config- commands

* help: remove --print-config- commands

* Manpage: change migrate-config to gen-config

* Manpage: add -h as shortcut for help

* Manpage: escaped all '-'
  • Loading branch information
mame98 authored Nov 18, 2023
1 parent 854a7cf commit 647403f
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ if(APPLE)
configure_file(src/util/apple/Info.plist.in Info.plist @ONLY)
endif()

string(TIMESTAMP FASTFETCH_BUILD_DATE "%d %B %Y")
configure_file(doc/fastfetch.1.in fastfetch.1 @ONLY)

####################
# Ascii image data #
####################
Expand Down Expand Up @@ -1033,6 +1036,11 @@ install(
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/licenses/${CMAKE_PROJECT_NAME}"
)

install(
FILES "${PROJECT_BINARY_DIR}/fastfetch.1"
DESTINATION "${CMAKE_INSTALL_MANDIR}"
)

##################
# package target #
##################
Expand Down
134 changes: 134 additions & 0 deletions doc/fastfetch.1.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
.TH FASTFETCH 1 "@FASTFETCH_BUILD_DATE@" "@CMAKE_PROJECT_NAME@ @CMAKE_PROJECT_VERSION@"

.SH NAME
fastfetch \- a neofetch\-like tool for fetching system information and
displaying them in a pretty way

.SH SYNOPSIS

.B fastfetch
.I [options...]

.SH DESCRIPTION

Fastfetch is a neofetch\-like tool for fetching system information and
displaying them in a pretty way. It is written mainly in C, with performance
and customizability in mind.
Currently, Linux, Android, FreeBSD, MacOS and Windows 7+ are supported.

.SH "EXIT STATUS"

On successfull execution, fastfetch returns zero. If any error happened,
the exit code will be non\-zero.

.SH OPTIONS

.SS "Informative Options"
.TP

.B \-h, \-\-help \fI [command]
Show help output, displaying all available options or help for given command
.TP

.B \-v, \-\-version
Show version of fastfetch
.TP

.B \-\-list\-config\-paths
List search paths of config files
.TP

.B \-\-list\-data\-paths
List search paths of presets and logos
.TP

.B \-\-list\-logos
List available logos, they can be loaded with \fI \-\-logo
.TP

.B \-\-list\-modules
List available modules
.TP

.B \-\-list\-presets
List available presets, they can be loaded with \fI \-\-config
.TP

.B \-\-list\-features
List the supported features fastfetch was compiled with
.TP

.B \-\-print\-logos
Print available logos
.TP

.B \-\-print\-structure
Print the default structure


.SS "Display Options"
.TP

.B \-l, \-\-logo \fI <logo>
Set the logo to display
.TP

.B \-s, \-\-structure \fI <structure>
Set the structure of the fetch. For details about the structure,
see the CONFIGURATION section.


.SS "Config Options"
.TP

.B \-c, \-\-config \fI <config>
Use the specified config file or preset. If "none", disable further config
loading. For details about config files, see the CONFIGURATION section
.TP

.B \-\-gen\-config \fI [file]
Generate a config file with options specified on the command line.
If \fI file \fR is specified, the configuration will written to the
file, otherwise it will be written to stdout.
.TP

.B \-\-gen\-config\-force \fI [file]
Same as \fB \-\-gen\-config\fR, but overwrites existing config
.TP


To list all options, use \fB \-\-help\fR this will also print all available module options.

.SH CONFIGURATION
.SS "Fetch Structure"
The structure of a fetch describes the modules that should be included in
the output. It consists of a string of modules, separated by a colon (:).
To list all available modules, use \fB \-\-list\-modules \fR

.SS "Config Files"

fastfetch supports two types of config files. The legacy
configuration files and a JSONC based format.

A JSONC config file is a JSON file that also supports comments with (//). Those
files must have the extension '.jsonc'. You can migrate a legacy config
file to the JSONC format by using \fB\-\-gen\-config\fR.

The specified configuration/preset files are searched in the following order:

1. relative to the current working directory

2. relative to ~/.local/share/fastfetch/presets/

3. relative to /usr/share/fastfetch/presets/

When both a '.jsonc' and a '.conf' file with the same name is found,
the '.jsonc' file is preferred.

Fastfetch provides some default presets. List them with \fB \-\-print\-available\-presets\fR.

.SH "SEE ALSO"
.BR neofetch (1)

.SH BUGS
Please report bugs to:\fI https://github.com/fastfetch\-cli/fastfetch/issues \fR
4 changes: 1 addition & 3 deletions src/data/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ Informative options:
--list-data-paths: List search paths of presets and logos
--list-logos: List available logos
--list-modules: List available modules
--list-presets: List presets fastfetch knows about; they can be loaded with --load-config (+)
--list-presets: List presets fastfetch knows about; they can be loaded with --config (+)
--list-features: List the supported features fastfetch was compiled with (mainly for development)
--print-logos: Print available logos
--print-config-system: Print the default system config
--print-config-user: Print the default user config
--print-structure: Print the default structure

Config options:
Expand Down

0 comments on commit 647403f

Please sign in to comment.