discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Warren Block <wblock@wonkity.com>
To: discuss@mdocml.bsd.lv
Subject: Formatting long commands in examples
Date: Sat, 13 Dec 2014 18:15:07 -0700 (MST)	[thread overview]
Message-ID: <alpine.BSF.2.11.1412131800260.6198@wonkity.com> (raw)

We've had a request to add long commands with long literal values to a 
man page.

For an example, see the "magic" and "mask" values at 
https://wiki.freebsd.org/QemuUserModeHowTo

.Bd -ragged -offset indent takes some liberties with wrapping the quoted 
literal values, and does not produce a warning.

.Bd -ragged -offset indent
# binmiscctl add mips64elf --interpreter "/usr/local/bin/qemu-mips64-static"
--magic "\\x7f\\x45\\x4c\\x46\\x02\\x02\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x08"
--mask "\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff"
--size 20 --set-enabled
.Ed

That produces an 80-column output like this:

            # binmiscctl add mips64elf --interpreter "/usr/local/bin/qemu-
            mips64-static" --magic
            "\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
            --mask
            "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff
            --size 20 --set-enabled

In addition to the undesirable wrapping of the value in the first line, 
the hex strings are cut off.

.Dl does not like this much, either.  One very long line:

.Dl "# binmiscctl add mips64elf --interpreter \"/usr/local/bin/qemu-mips64-static\" --magic \"\\x7f\\x45\\x4c\\x46\\x02\\x02\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x08\" --mask \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\" --size 20 --set-enabled"

Whether or not the parameter is quoted, it only produces this:

            # binmiscctl add mips64elf --interpreter

There might not be a good way to show these commands.  Is there a "least 
bad" way?  It would be preferable to wrap the long arguments rather than 
silently truncate them.
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

             reply	other threads:[~2014-12-14  1:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-14  1:15 Warren Block [this message]
2014-12-14  6:53 ` Ingo Schwarze
2014-12-15 23:28   ` Warren Block

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.BSF.2.11.1412131800260.6198@wonkity.com \
    --to=wblock@wonkity.com \
    --cc=discuss@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).