Skip to content

Commit

Permalink
futhark fmt deserves its own manpage.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Nov 4, 2024
1 parent 09c4284 commit d8f284b
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 7 deletions.
7 changes: 7 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,13 @@ class FutharkLexer(RegexLexer):
[],
1,
),
(
"man/futhark-fmt",
"futhark-fmt",
"format Futhark programs",
[],
1,
),
("man/futhark-pkg", "futhark-pkg", "manage Futhark packages", [], 1),
(
"man/futhark-literate",
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ the `development blog <https://futhark-lang.org/blog.html>`_.
man/futhark-cuda.rst
man/futhark-dataset.rst
man/futhark-doc.rst
man/futhark-fmt.rst
man/futhark-hip.rst
man/futhark-ispc.rst
man/futhark-literate.rst
Expand Down
39 changes: 39 additions & 0 deletions docs/man/futhark-fmt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. role:: ref(emphasis)

.. _futhark-fmt(1):

===========
futhark-fmt
===========

SYNOPSIS
========

futhark fmt [FILES]

DESCRIPTION
===========

Reformat the given Futhark programs. If no files are provided, read
Futhark program on stdin and produce formatted output on stdout. If
stdout is a terminal, the output will be syntax highlighted.

In contrast to many other automatic formatters, the formatting is
somewhat sensitive to the formatting of the input program. In
particular, single-line expressions will usually be kept on a single
line, even if they are very long. To force ``futhark fmt`` to break
these, insert a linebreak at an arbitrary location.

OPTIONS
=======

-h
Print help text to standard output and exit.

-V
Print version information on standard output and exit.

SEE ALSO
========

:ref:`futhark-doc(1)`
7 changes: 0 additions & 7 deletions docs/man/futhark.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ futhark eval [-f FILE] [-w] <exprs...>
Evaluates expressions given as command-line arguments. Optionally
allows a file import using ``-f``.

futhark fmt [FILE]
------------------

Reformat the given Futhark program. If no file is provided, read
Futhark program on stdin and produce formatted output on stdout. If
stdout is a terminal, the output will be syntax highlighted.

futhark hash PROGRAM
--------------------

Expand Down

0 comments on commit d8f284b

Please sign in to comment.