Skip to content

Commit 168dd31

Browse files
anundmitchellh
authored andcommitted
documentation: consistent format for actions help
1 parent 148a009 commit 168dd31

File tree

9 files changed

+43
-23
lines changed

9 files changed

+43
-23
lines changed

src/cli/action.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ pub const Action = enum {
4545
// Validate passed config file
4646
@"validate-config",
4747

48-
// List, (eventually) view, and (eventually) send crash reports.
49-
@"crash-report",
50-
5148
// Show which font face Ghostty loads a codepoint from.
5249
@"show-face",
5350

51+
// List, (eventually) view, and (eventually) send crash reports.
52+
@"crash-report",
53+
5454
pub const Error = error{
5555
/// Multiple actions were detected. You can specify at most one
5656
/// action on the CLI otherwise the behavior desired is ambiguous.

src/cli/help.zig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ pub const Options = struct {
1515
}
1616
};
1717

18-
/// The `help` command shows general help about Ghostty. You can also specify
19-
/// `--help` or `-h` along with any action such as `+list-themes` to see help
20-
/// for a specific action.
18+
/// The `help` command shows general help about Ghostty. Recognized as either
19+
/// `-h, `--help`, or like other actions `+help`.
20+
///
21+
/// You can also specify `--help` or `-h` along with any action such as
22+
/// `+list-themes` to see help for a specific action.
2123
pub fn run(alloc: Allocator) !u8 {
2224
var opts: Options = .{};
2325
defer opts.deinit();

src/cli/list_actions.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ pub const Options = struct {
2424
/// actions for Ghostty. These are distinct from the CLI Actions which can
2525
/// be listed via `+help`
2626
///
27-
/// The `--docs` argument will print out the documentation for each action.
27+
/// Flags:
28+
///
29+
/// * `--docs`: will print out the documentation for each action.
2830
pub fn run(alloc: Allocator) !u8 {
2931
var opts: Options = .{};
3032
defer opts.deinit();

src/cli/list_fonts.zig

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,21 @@ pub const Options = struct {
4444
/// the sorting will be disabled and the results instead will be shown in the
4545
/// same priority order Ghostty would use to pick a font.
4646
///
47-
/// The `--family` argument can be used to filter results to a specific family.
48-
/// The family handling is identical to the `font-family` set of Ghostty
49-
/// configuration values, so this can be used to debug why your desired font may
50-
/// not be loading.
47+
/// Flags:
5148
///
52-
/// The `--bold` and `--italic` arguments can be used to filter results to
53-
/// specific styles. It is not guaranteed that only those styles are returned,
54-
/// it will just prioritize fonts that match those styles.
49+
/// * `--bold`: Filter results to specific bold styles. It is not guaranteed
50+
/// that only those styles are returned. They are only prioritized.
51+
///
52+
/// * `--italic`: Filter results to specific italic styles. It is not guaranteed
53+
/// that only those styles are returned. They are only prioritized.
54+
///
55+
/// * `--style`: Filter results based on the style string advertised by a font.
56+
/// It is not guaranteed that only those styles are returned. They are only
57+
/// prioritized.
58+
///
59+
/// * `--family`: Filter results to a specific font family. The family handling
60+
/// is identical to the `font-family` set of Ghostty configuration values, so
61+
/// this can be used to debug why your desired font may not be loading.
5562
pub fn run(alloc: Allocator) !u8 {
5663
var iter = try args.argsIterator(alloc);
5764
defer iter.deinit();

src/cli/list_keybinds.zig

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,15 @@ pub const Options = struct {
4242
/// changes to the keybinds it will print out the default ones configured for
4343
/// Ghostty
4444
///
45-
/// The `--default` argument will print out all the default keybinds configured
46-
/// for Ghostty
45+
/// Flags:
4746
///
48-
/// The `--plain` flag will disable formatting and make the output more
49-
/// friendly for Unix tooling. This is default when not printing to a tty.
47+
/// * `--default`: will print out all the default keybinds
48+
///
49+
/// * `--docs`: currently does nothing, intended to print out documentation
50+
/// about the action associated with the keybinds
51+
///
52+
/// * `--plain`: will disable formatting and make the output more
53+
/// friendly for Unix tooling. This is default when not printing to a tty.
5054
pub fn run(alloc: Allocator) !u8 {
5155
var opts: Options = .{};
5256
defer opts.deinit();

src/cli/list_themes.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ const ThemeListElement = struct {
9191
/// Flags:
9292
///
9393
/// * `--path`: Show the full path to the theme.
94+
///
9495
/// * `--plain`: Force a plain listing of themes.
9596
pub fn run(gpa_alloc: std.mem.Allocator) !u8 {
9697
var opts: Options = .{};

src/cli/validate_config.zig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ pub const Options = struct {
2323

2424
/// The `validate-config` command is used to validate a Ghostty config file.
2525
///
26-
/// When executed without any arguments, this will load the config from the default location.
26+
/// When executed without any arguments, this will load the config from the default
27+
/// location.
2728
///
28-
/// The `--config-file` argument can be passed to validate a specific target config
29-
/// file in a non-default location.
29+
/// Flags:
30+
///
31+
/// * `--config-file`: can be passed to validate a specific target config file in
32+
/// a non-default location
3033
pub fn run(alloc: std.mem.Allocator) !u8 {
3134
var opts: Options = .{};
3235
defer opts.deinit();

src/cli/version.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const gtk = if (build_config.app_runtime == .gtk) @import("../apprt/gtk/c.zig").
1010

1111
pub const Options = struct {};
1212

13-
/// The `version` command is used to display information about Ghostty.
13+
/// The `version` command is used to display information about Ghostty. Recognized as
14+
/// either `+version` or `--version`.
1415
pub fn run(alloc: Allocator) !u8 {
1516
_ = alloc;
1617

src/shell-integration/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ supports.
66

77
This README is meant as developer documentation and not as
88
user documentation. For user documentation, see the main
9-
README.
9+
README or [ghostty.org](https://ghostty.org/docs)
1010

1111
## Implementation Details
1212

0 commit comments

Comments
 (0)