• Usage/Help Screen Conventions

    From Michael Sanders@3:633/10 to All on Thu Nov 6 04:29:45 2025
    Rounding the corner to completion on a project
    I've worked on for 5 or 6 years & now I'm stumped
    by a very simple thing...

    When the user passes no arguments, I default to
    the panel below, yet I wonder if its expressed
    concisely enough to avoid confusion or promote it...

    I don't feel its too bad, but then again I know
    what its doing while others wont.

    Hoping to read responses on you'd express this.

    Syntax: tinybase OPTION - INPUT

    Options (use 1 option per invocation):

    Tag query: -q 'comma seperated queries'
    Tag index: -t
    Tinybase manual: -m

    Input:

    File list: - file1 file2 file3
    Stdin: - <<EOF

    Examples:

    tinybase -q 'query1, query2, query3' - *.txt
    tinybase -t - *.txt
    tinybase -m > manual.txt

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Thu Nov 6 06:40:43 2025
    On 06.11.2025 05:29, Michael Sanders wrote:
    Rounding the corner to completion on a project
    I've worked on for 5 or 6 years & now I'm stumped
    by a very simple thing...

    When the user passes no arguments, I default to
    the panel below, yet I wonder if its expressed
    concisely enough to avoid confusion or promote it...

    I don't feel its too bad, but then again I know
    what its doing while others wont.

    Hoping to read responses on you'd express this.

    There's no clear standard and you can certainly find
    various forms. It's probably also depending on taste
    to some degree. But there's also a common subset that
    you often find. Some impressions on the sample below...


    Syntax: tinybase OPTION - INPUT

    I find a line like this not very useful (per se).


    Options (use 1 option per invocation):

    If that's the case you don't really need a '-' or '--'
    to terminate options.


    Tag query: -q 'comma seperated queries'
    Tag index: -t
    Tinybase manual: -m

    Input:

    File list: - file1 file2 file3
    Stdin: - <<EOF

    While file arguments are part of the interface syntax
    redirections (like <<EOF) are just technical shell
    building blocks; I wouldn't include them in the usage
    description.


    Examples:

    tinybase -q 'query1, query2, query3' - *.txt
    tinybase -t - *.txt
    tinybase -m > manual.txt

    Examples are fine (but '-' is syntactically unnecessary).
    A description is completely missing. (And a manual page
    should also have information about exit status codes.)

    My preference for usage information goes in the direction
    (despite being also - like your "Syntax" line - formally
    not perfectly accurate)...


    Synopsis:
    tinybase [ -q queries... | -t | -m ] files...

    Options:
    -q queries... comma separated list of queries
    -t <tag index?>
    -m show manual

    Description:
    ...

    Examples:
    tinybase -q 'query1, query2, query3' - *.txt
    tinybase -t - *.txt
    tinybase -m > manual.txt


    Where a quick usage help would just print a single line
    Usage: tinybase [ -q queries... | -t | -m ] files...
    and a verbose information or manual page would show the
    complete information. (I would support both, terse usage
    and full information. No arguments provided could just
    show the usage and '-?' or similar could provide details.
    There's various possibilities depending on the character
    and complexity of the tool, what information you want to
    obtain quickly and when you need details.)

    I also suggest to just inspect what other programs and
    tools do here. You will get a feeling then what's there
    and whether it's enough for you to understand that tool.
    Add thereby identifying those sections and contents in
    your info page that is missing in your tool-information
    to understand it.

    Janis


    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Richard Heathfield@3:633/10 to All on Thu Nov 6 06:24:35 2025
    On 06/11/2025 04:29, Michael Sanders wrote:
    Rounding the corner to completion on a project
    I've worked on for 5 or 6 years & now I'm stumped
    by a very simple thing...

    When the user passes no arguments, I default to
    the panel below, yet I wonder if its expressed
    concisely enough to avoid confusion or promote it...

    I don't feel its too bad, but then again I know
    what its doing while others wont.

    Don't try and teach in an if(argc <

    People who type the program name alone need one of two things:

    a) a brief description of the program's purpose;

    OR

    b) a brief reminder of usage.

    Here's an example from my own corpus:

    $ transpose
    transpose infile amount [outfile]
    transposes a Lilypond metafile ($TRANSPOSE$ tag present)
    from one key to another.
    infile: the file to transpose
    amount: number of semitones to transpose (-ve = down, +ve = up)
    outfile: if specified, output is written here.
    Otherwise, the input file is modified.


    That's enough to
    a) tell you whether it's the program you wanted, or
    b) remind you of how you use it

    It doesn't try to teach you music theory. If your program needs a
    manual, your descriptive passage should point at it - eg See
    README for more details.

    Syntax: tinybase OPTION - INPUT

    I'd say FILE(S) rather than INPUT

    Options (use 1 option per invocation):

    OPTION: one of

    Tag query: -q 'comma seperated queries'

    sepArated - but it's not clear whether the 'text in quotes' is
    part of the syntax or just an aside.

    Input:

    FILE(S) is less ambiguous. If your user doesn't know what files
    are and you try to teach him, you're in for a world of hurt.

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Fri Nov 7 10:43:33 2025
    On Thu, 6 Nov 2025 06:40:43 +0100, Janis Papanagnou wrote:

    While file arguments are part of the interface syntax
    redirections (like <<EOF) are just technical shell
    building blocks; I wouldn't include them in the usage
    description.

    Noted.

    Examples are fine (but '-' is syntactically unnecessary).
    A description is completely missing. (And a manual page
    should also have information about exit status codes.)

    Yes.

    My preference for usage information goes in the direction
    (despite being also - like your "Syntax" line - formally
    not perfectly accurate)...


    Synopsis:
    tinybase [ -q queries... | -t | -m ] files...

    Options:
    -q queries... comma separated list of queries
    -t <tag index?>
    -m show manual

    Description:
    ...

    Examples:
    tinybase -q 'query1, query2, query3' - *.txt
    tinybase -t - *.txt
    tinybase -m > manual.txt

    That's closer to what I what in fact.

    As always, thanks Janis, lots of good info.
    Slowly but surely I move forward.

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Fri Nov 7 10:47:32 2025
    On Thu, 6 Nov 2025 06:24:35 +0000, Richard Heathfield wrote:

    Don't try and teach in an if(argc <

    People who type the program name alone need one of two things:

    a) a brief description of the program's purpose;

    OR

    b) a brief reminder of usage.

    That's it right there.

    Here's an example from my own corpus:

    $ transpose
    transpose infile amount [outfile]
    transposes a Lilypond metafile ($TRANSPOSE$ tag present)
    from one key to another.
    infile: the file to transpose
    amount: number of semitones to transpose (-ve = down, +ve = up)
    outfile: if specified, output is written here.
    Otherwise, the input file is modified.

    That's enough to
    a) tell you whether it's the program you wanted, or
    b) remind you of how you use it

    It doesn't try to teach you music theory. If your program needs a
    manual, your descriptive passage should point at it - eg See
    README for more details.

    Yes, understood.

    FILE(S) is less ambiguous. If your user doesn't know what files
    are and you try to teach him, you're in for a world of hurt.

    Solid reply Richard, many thanks for the insights.

    Glad I asked now. Between you & Janis I've got (knock on wood)
    most of what I need now.

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Ben Bacarisse@3:633/10 to All on Fri Nov 7 13:08:26 2025
    Michael Sanders <porkchop@invalid.foo> writes:

    When the user passes no arguments, I default to
    the panel below, yet I wonder if its expressed
    concisely enough to avoid confusion or promote it...

    You've had good answers, but I'll add a couple of remarks that I don't
    think came up.

    Syntax: tinybase OPTION - INPUT

    Avoid - as a separator in either descriptions or argument lists as it is
    used so often for flags. I can't tell is I need to type it or if you
    are using it simply as a textual description device.

    Options (use 1 option per invocation):

    Tag query: -q 'comma seperated queries'
    Tag index: -t
    Tinybase manual: -m

    These options are, essentially, "modes". The utility provides three
    things it can do and they can't be mixed. Some utilities use alternate
    names: tinybase-query, tinybase-tag and tinybase-manual would all be
    symbolic links to one executable. That's probably over the top for this program, but I would describe it as three separate use cases with three separate syntax lines.

    Input:

    File list: - file1 file2 file3
    Stdin: - <<EOF

    You don't need to tell people about << (or > below). For one thing, you
    can't cover all the bases (what about <(...) or <<<word or <<'EOF' vs
    <<EOF?) and for another, your uses will know these basics.

    Examples:

    tinybase -q 'query1, query2, query3' - *.txt
    tinybase -t - *.txt
    tinybase -m > manual.txt

    Your examples show me that the - is needed as a required separator
    (except for -m). That's not very "unixy". I would prefer the file
    names to be assumed and the queries explicit as that is more in line
    with what old timers might expect:

    tinybase -q query1 -q query2 -q query3 *.txt
    tinybase -t *.txt
    tinybase -m

    I.e. the three syntax lines might be

    tinybase -m
    tinybase -t [file names...]
    tinybase -q query [-q query]... [file names...]

    --
    Ben.

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Fri Nov 7 19:25:35 2025
    On Fri, 07 Nov 2025 13:08:26 +0000, Ben Bacarisse wrote:

    These options are, essentially, "modes". The utility provides three
    things it can do and they can't be mixed. Some utilities use alternate names: tinybase-query, tinybase-tag and tinybase-manual would all be
    symbolic links to one executable. That's probably over the top for this program, but I would describe it as three separate use cases with three separate syntax lines.

    Well hey there Ben, hope you're doing alright.

    Also hope Janis & Richard are reading too as I've tried
    to incorporate the best of all three of your replies.

    Here's where I'm at (like your 'mode' anaology):

    Usage: tinybase [ -q queries... | -t | -m ] [ files... ]

    Options:

    -q query mode: find blocks with matching tags or wildcards
    example: tinybase -q 'query1, query2' files
    (if no files are given, reads from standard input)

    -t tag index mode: list all unique tags across the given files
    example: tinybase -t files

    -m manual mode: show the built-in documentation

    Notes:

    Multiple queries are comma-separated.
    Wildcards (*, ?) are supported in queries.
    When no files are provided, stdin is read automatically.

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Nov 7 19:43:28 2025
    On Fri, 7 Nov 2025 19:25:35 -0000 (UTC), Michael Sanders wrote:

    Here's where I'm at (like your 'mode' anaology):

    Usage: tinybase [ -q queries... | -t | -m ] [ files... ]

    Options:

    -q query mode: find blocks with matching tags or wildcards
    example: tinybase -q 'query1, query2' files (if no files are
    given, reads from standard input)

    -t tag index mode: list all unique tags across the given files
    example: tinybase -t files

    -m manual mode: show the built-in documentation

    Notes:

    Multiple queries are comma-separated.
    Wildcards (*, ?) are supported in queries.
    When no files are provided, stdin is read automatically.

    Now you?re starting to write an entire man page within your program.

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Scott Lurndal@3:633/10 to All on Fri Nov 7 19:51:28 2025
    Michael Sanders <porkchop@invalid.foo> writes:
    On Fri, 07 Nov 2025 13:08:26 +0000, Ben Bacarisse wrote:

    These options are, essentially, "modes". The utility provides three
    things it can do and they can't be mixed. Some utilities use alternate
    names: tinybase-query, tinybase-tag and tinybase-manual would all be
    symbolic links to one executable. That's probably over the top for this
    program, but I would describe it as three separate use cases with three
    separate syntax lines.

    Well hey there Ben, hope you're doing alright.

    Also hope Janis & Richard are reading too as I've tried
    to incorporate the best of all three of your replies.

    Here's where I'm at (like your 'mode' anaology):

    Usage: tinybase [ -q queries... | -t | -m ] [ files... ]

    Options:

    -q query mode: find blocks with matching tags or wildcards
    example: tinybase -q 'query1, query2' files
    (if no files are given, reads from standard input)

    It is common for utilities to accept '-' as a filename
    which indicates that input should come from stdin.

    For example;

    NAME
    cat - concatenate files and print on the standard output

    SYNOPSIS
    cat [OPTION]... [FILE]...

    DESCRIPTION
    Concatenate FILE(s) to standard output.

    With no FILE, or when FILE is -, read standard input.


    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Fri Nov 7 19:51:29 2025
    On Fri, 7 Nov 2025 19:43:28 -0000 (UTC), Lawrence D?Oliveiro wrote:

    Now you?re starting to write an entire man page within your program.

    Emacs! =)

    I'm working on whittling it down Lawrence, its just that I cant hit
    that elusive (for me) mark between terse/concise.

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Fri Nov 7 19:57:27 2025
    On Fri, 07 Nov 2025 19:51:28 GMT, Scott Lurndal wrote:

    It is common for utilities to accept '-' as a filename
    which indicates that input should come from stdin.

    For example;

    NAME
    cat - concatenate files and print on the standard output

    Hi Scott & thanks for the input.

    I'm studying cat, grep, etc... & my sed...

    is close to ambiguous (from a newbie's point of view):

    Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]...

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Richard Heathfield@3:633/10 to All on Fri Nov 7 21:25:52 2025
    On 07/11/2025 19:25, Michael Sanders wrote:
    On Fri, 07 Nov 2025 13:08:26 +0000, Ben Bacarisse wrote:

    These options are, essentially, "modes". The utility provides three
    things it can do and they can't be mixed. Some utilities use alternate
    names: tinybase-query, tinybase-tag and tinybase-manual would all be
    symbolic links to one executable. That's probably over the top for this
    program, but I would describe it as three separate use cases with three
    separate syntax lines.

    Well hey there Ben, hope you're doing alright.

    Also hope Janis & Richard are reading too as I've tried
    to incorporate the best of all three of your replies.

    Here's where I'm at (like your 'mode' anaology):

    Usage: tinybase [ -q queries... | -t | -m ] [ files... ]

    Options:

    -q query mode: find blocks with matching tags or wildcards
    example: tinybase -q 'query1, query2' files
    (if no files are given, reads from standard input)

    -t tag index mode: list all unique tags across the given files
    example: tinybase -t files

    -m manual mode: show the built-in documentation

    Notes:

    Multiple queries are comma-separated.
    Wildcards (*, ?) are supported in queries.
    When no files are provided, stdin is read automatically.

    I'm pretty sure I've read every article in this thread, but I
    still have no idea what tinybase actually does. Is it an analyser
    for alkaline chemical structures, or a nucleobase designer, or a
    microRDBMS, or what?

    tinybase really ought to tell you that, in just a sentence or two.

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Fri Nov 7 22:50:49 2025
    On Fri, 7 Nov 2025 21:25:52 +0000, Richard Heathfield wrote:

    I'm pretty sure I've read every article in this thread, but I
    still have no idea what tinybase actually does. Is it an analyser
    for alkaline chemical structures, or a nucleobase designer, or a
    microRDBMS, or what?

    tinybase really ought to tell you that, in just a sentence or two.

    Yup you're absolutely right. Here's my latest. Getting close...

    Usage: tinybase [ -q queries... | -t | -r | -m ] [ files... ]

    Synopsis: Tag based search tool

    Options:

    -q query mode: find blocks with matching tags or wildcards
    example: tinybase -q 'query1, query2' files

    -t tag index mode: list all unique tags across given files
    example: tinybase -t files

    -r repl mode: interactive shell for tag queries
    example: tinybase -r files

    -m manual mode: show built-in documentation

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Fri Nov 7 15:24:25 2025
    Michael Sanders <porkchop@invalid.foo> writes:
    On Fri, 7 Nov 2025 21:25:52 +0000, Richard Heathfield wrote:
    I'm pretty sure I've read every article in this thread, but I
    still have no idea what tinybase actually does. Is it an analyser
    for alkaline chemical structures, or a nucleobase designer, or a
    microRDBMS, or what?

    tinybase really ought to tell you that, in just a sentence or two.

    Yup you're absolutely right. Here's my latest. Getting close...

    Usage: tinybase [ -q queries... | -t | -r | -m ] [ files... ]

    Synopsis: Tag based search tool

    Options:

    -q query mode: find blocks with matching tags or wildcards
    example: tinybase -q 'query1, query2' files

    -t tag index mode: list all unique tags across given files
    example: tinybase -t files

    -r repl mode: interactive shell for tag queries
    example: tinybase -r files

    -m manual mode: show built-in documentation

    I would remove most or all of the blank lines, just to avoid using up
    too much of the user's screen real estate. The longer your usage
    message, the more of the user's on-screen information might be lost.

    For a program that requires at least some command-line arguments, a very
    short message that points the user to a "-h" or "--help" option can be
    useful. Don't show a very long usage message unless the user explicitly
    asks for it. GNU coreutils rm is a decent example:

    $ rm
    rm: missing operand
    Try 'rm --help' for more information.

    "rm --help" prints a 39-line message. (I'm not going to get into
    whether "-h" or "--help" is better. The latter is a GNU convention.)

    Unfortunately, this doesn't work for a command that can validly be run
    with no arguments, like cat.

    Print error messages to stderr, usage messages (at least if
    requested via some kind of help option) to stdout. I've seem
    commands where "foo --help" prints more text than can fit on my
    screen, and "foo --help | less" shows me nothing because the output
    I asked for was sent to stderr. (This is getting a bit OS-specific,
    but it's applicable to any Unix-like system, and your use of '-'
    to introduce arguments suggest that that's what you're aiming for.)

    Something else you might consider is how you handle the different
    modes. If I understand correctly (and I'm not at all sure I do),
    "-q", "-t", "-r", and "-m" are distinct modes, and you have
    to specify exactly one. If that's the case, you might consider
    making them subcommands, similar to the way "git" has "git commit",
    "git log", et al.

    tinybase query ...
    tinybase tag ...
    tinybase repl ...
    tinybase manual ...

    If you like, you can allow the subcommand name to be abbreviated.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Sat Nov 8 02:49:24 2025
    On 08.11.2025 00:24, Keith Thompson wrote:
    [...]

    For a program that requires at least some command-line arguments, a very short message that points the user to a "-h" or "--help" option can be useful. Don't show a very long usage message unless the user explicitly
    asks for it. [...]

    The previously already mentioned two-level help is indeed to prefer.


    "rm --help" prints a 39-line message. (I'm not going to get into
    whether "-h" or "--help" is better. The latter is a GNU convention.)

    The problem with a choice of -h for that is that this letter h might
    be a good choice for an existing functional option and would then not
    be available any more for that. (I thus consider this "convention" a
    badly decided thing as far as -h is concerned, while --help is okay.)

    We've thus used -? for that usage purpose, a _non-letter_ character;
    it was standard in all our tools and I'm still using that convention
    in my private context.

    In that light it's also interesting to have a look into ksh's getopts
    built-in function. If you use that function in your programs you have automatically some help standard formats and outputs generated. If
    you type (in ksh) getopts --man you will get its man-page and find at
    the bottom these built-ins standards for help information:
    -? To generate a usage synopsis.
    --?? To generate a verbose usage message.
    --??man
    To generate a formatted man page.
    --??api
    To generate an easy to parse usage message.
    --??html
    To generate a man page in html format.
    --??nroff
    To generate a man page in nroff format.
    --??usage
    List the current optstring.

    That comes all for free [when using ksh getopts].

    But the choices are IMO also a good paragon; -? for single line usage,
    --?? for a verbose information. (For the latter I'd prefer --help and
    instead of --??man it seems that --man also suffices; that at least
    produces the same result for getopts --man and getopts --??man.)

    For a three-level verbosity, -?, --help, --man, would be my choice.


    Unfortunately, this doesn't work for a command that can validly be run
    with no arguments, like cat.

    Programs that accept no arguments (e.g. in filters that assume input
    from stdin instead of from files then) you would have to use something
    like -? (although cat, specifically, doesn't support that, sadly). For
    other programs, those that need arguments, omitting any argument should
    produce a one-liner usage message, IMO. Using -? could be widely used
    for all cases.


    Print error messages to stderr, usage messages (at least if
    requested via some kind of help option) to stdout. I've seem
    commands where "foo --help" prints more text than can fit on my
    screen, and "foo --help | less" shows me nothing because the output
    I asked for was sent to stderr.

    This is also what ksh does. I think that's a very unfortunate decision; especially because of the reason you mentioned, piping through a pager.

    Janis

    [...]



    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Fri Nov 7 19:00:13 2025
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    [...]
    The problem with a choice of -h for that is that this letter h might
    be a good choice for an existing functional option and would then not
    be available any more for that. (I thus consider this "convention" a
    badly decided thing as far as -h is concerned, while --help is okay.)

    We've thus used -? for that usage purpose, a _non-letter_ character;
    it was standard in all our tools and I'm still using that convention
    in my private context.
    [...]

    '?' is a shell wildcard, matching a single character in a file name.

    "foo -?" will expand to "foo -x" if you happen to have a file in
    the current directory named "-x" (and foo's "-x" option obviously
    tells it to delete your home directory). If you have no such file,
    the behavior of "foo -?" depends on your shell and its settings,
    but typically no substitution takes place.

    This is specific to the behavior of shells on Unix-like systems,
    but if you're writing a C program intended to work on such systems
    (and possibly others), it's good to be aware of the issue.

    Few Unix commands use "-?" to mean "print a usage message".
    For those that do, I would escape the question mark.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Richard Heathfield@3:633/10 to All on Sat Nov 8 04:38:53 2025
    On 07/11/2025 23:24, Keith Thompson wrote:

    <snip>

    "rm --help" prints a 39-line message.

    Of which the top two are:

    Usage: rm [OPTION]... [FILE]...
    Remove (unlink) the FILE(s).

    I know what a file is, but what the hell is a tag? Graffiti tag?
    Dog tag? Ear tag? Electronic tag? Kimball tag? Pet tag? Price
    tag? RFID tag? Toe tag? Triage tag?

    Don't be an idiot, Richard! It'll be computer-related, *obviously*.

    Oh, of course... except that, under 'Computing', Wikipedia's
    disambiguation page for 'tag' lists a dozen entries.

    So I *still* don't know what tinybase does. It's like you're
    trying to hide it.

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Sat Nov 8 07:58:31 2025
    On Fri, 7 Nov 2025 19:51:29 -0000 (UTC), Michael Sanders wrote:

    On Fri, 7 Nov 2025 19:43:28 -0000 (UTC), Lawrence D?Oliveiro wrote:

    Now you?re starting to write an entire man page within your program.

    Emacs! =)

    I'm working on whittling it down Lawrence, its just that I cant hit that elusive (for me) mark between terse/concise.

    These days, I don?t bother. For more complex projects, I write up a
    detailed man page and include it with the program.

    Probably my largest such project: <https://gitlab.com/ldo/render-useful/>

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Sat Nov 8 11:09:51 2025
    On 08.11.2025 04:00, Keith Thompson wrote:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    [...]
    The problem with a choice of -h for that is that this letter h might
    be a good choice for an existing functional option and would then not
    be available any more for that. (I thus consider this "convention" a
    badly decided thing as far as -h is concerned, while --help is okay.)

    We've thus used -? for that usage purpose, a _non-letter_ character;
    it was standard in all our tools and I'm still using that convention
    in my private context.
    [...]

    '?' is a shell wildcard, matching a single character in a file name.

    Yes, any files named like <dash><letter> will get then expanded
    in standard Unix shell (with standard settings), and one should
    be aware of that. It's good to mention that (since I forgot to
    do so)!

    In decades of practice I've not met such filenames in practice,
    though; and that's explainable, because it's semantically an
    arguably sensible name, and if you have files with such names
    you usually cannot use most of the Unix tools anyway (without
    precautions) since such filenames would be interpreted in tools
    as option so that most tools won't work with them; then you'd
    have to also indicate end-of-options with the tool (like '--')
    or use tool-specific "escape-options" (like in grep with '-e').

    But there sometimes also erroneously created files with such
    names in the file system, and (as you subsequently demonstrate
    it) such an inadvertently created file may make troubles then.


    "foo -?" will expand to "foo -x" if you happen to have a file in
    the current directory named "-x" (and foo's "-x" option obviously
    tells it to delete your home directory). If you have no such file,
    the behavior of "foo -?" depends on your shell and its settings,
    but typically no substitution takes place.

    (Or in shell context, where appropriate, you can also just
    disable the filename globbing so that it doesn't expand.)


    This is specific to the behavior of shells on Unix-like systems,
    but if you're writing a C program intended to work on such systems
    (and possibly others), it's good to be aware of the issue.

    Few Unix commands use "-?" to mean "print a usage message".
    For those that do, I would escape the question mark.

    In practice it doesn't seem to be necessary (mileages may
    vary), but quoting "locally" disables expansions and makes
    it safer for contexts where such filenames are used, indeed.

    Though, the additional characters (-\? or "-?" or '-?') may
    be considered an annoyance and a suboptimal choice of -? in
    the first place for contexts with dash-char named files.

    Janis


    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Sat Nov 8 13:12:30 2025
    On Fri, 07 Nov 2025 15:24:25 -0800, Keith Thompson wrote:

    I would remove most or all of the blank lines, just to avoid using up
    too much of the user's screen real estate. The longer your usage
    message, the more of the user's on-screen information might be lost.

    For a program that requires at least some command-line arguments, a very short message that points the user to a "-h" or "--help" option can be useful. Don't show a very long usage message unless the user explicitly
    asks for it. GNU coreutils rm is a decent example:

    $ rm
    rm: missing operand
    Try 'rm --help' for more information.

    "rm --help" prints a 39-line message. (I'm not going to get into
    whether "-h" or "--help" is better. The latter is a GNU convention.)

    Unfortunately, this doesn't work for a command that can validly be run
    with no arguments, like cat.

    Print error messages to stderr, usage messages (at least if
    requested via some kind of help option) to stdout. I've seem
    commands where "foo --help" prints more text than can fit on my
    screen, and "foo --help | less" shows me nothing because the output
    I asked for was sent to stderr. (This is getting a bit OS-specific,
    but it's applicable to any Unix-like system, and your use of '-'
    to introduce arguments suggest that that's what you're aiming for.)

    Something else you might consider is how you handle the different
    modes. If I understand correctly (and I'm not at all sure I do),
    "-q", "-t", "-r", and "-m" are distinct modes, and you have
    to specify exactly one. If that's the case, you might consider
    making them subcommands, similar to the way "git" has "git commit",
    "git log", et al.

    tinybase query ...
    tinybase tag ...
    tinybase repl ...
    tinybase manual ...

    If you like, you can allow the subcommand name to be abbreviated.

    Excellent info here Keith, many thanks. I have some thoughts on
    these things (bias is coming from a Windows world on this end)
    & I want to study your remarks more before I ask any questions,
    please stay tuned...

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Sat Nov 8 13:16:43 2025
    On Sat, 8 Nov 2025 04:38:53 +0000, Richard Heathfield wrote:

    So I *still* don't know what tinybase does. It's like you're
    trying to hide it.

    No, not hiding anything, just moving slowly, learning as I go,
    trying to do the right thing. At any rate...

    Bearing in mind I'm defining my own terminology, tinybase
    (which is really only a working title & could change)
    searches for tagged blocks. Tagged blocks take this form:

    tags: 1998, analytics, sales, frank j. smith

    line 1
    line 2
    line nth...

    So if one invoked tinybase as...

    tinybase -q 'shuf*' *.tbf

    Here, the result is...

    FILE: data/awk.tbf
    LINE: 94
    BLOCK: 6
    QUERY: shuf*
    MATCH: shuffle

    TAGS: shuffle, awk, code, [numlines]

    001 # Fisher/Yates shuffle
    002
    003 function shuffle(card_array, number_of_cards, x, y, tmpvar) {
    004
    005 srand()
    006
    007 for (y = number_of_cards; y > 1; y--) {
    008 x = int((y-1) * rand()) + 1
    009 tmpvar = card_array[x]
    010 card_array[x] = card_array[y]
    011 card_array[y] = tmpvar
    012 }
    013
    014 }

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Richard Heathfield@3:633/10 to All on Sat Nov 8 13:46:43 2025
    On 08/11/2025 13:16, Michael Sanders wrote:

    <snip>

    trying to do the right thing.

    Fair enough. Here the right thing is to describe in a few words
    what your program does. Over a hundred isn't a few.

    I'd give you a hand, but after reading your 114-word description
    I was left none the wiser.

    I don't be think I'll be replying again because I'm not sure I
    can think of another way of saying 'describe in a few words what
    your program does'.

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Sat Nov 8 14:23:03 2025
    On Sat, 8 Nov 2025 13:46:43 +0000, Richard Heathfield wrote:

    Fair enough. Here the right thing is to describe in a few words
    what your program does. Over a hundred isn't a few.

    I'd give you a hand, but after reading your 114-word description
    I was left none the wiser.

    I don't be think I'll be replying again because I'm not sure I
    can think of another way of saying 'describe in a few words what
    your program does'.

    Sorry I disagree: You're simultaneously telling me too much info
    is bad while too little is bad as well?

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From James Kuyper@3:633/10 to All on Sat Nov 8 10:30:22 2025
    On 2025-11-08 09:23, Michael Sanders wrote:
    On Sat, 8 Nov 2025 13:46:43 +0000, Richard Heathfield wrote:

    Fair enough. Here the right thing is to describe in a few words what
    your program does. Over a hundred isn't a few.

    I'd give you a hand, but after reading your 114-word description I
    was left none the wiser.

    I don't be think I'll be replying again because I'm not sure I can
    think of another way of saying 'describe in a few words what your
    program does'.

    Sorry I disagree: You're simultaneously telling me too much info
    is bad while too little is bad as well?

    No, the key thing he's pointing out it that it's not clear what the
    description you've provided means. At least, like Richard, after reading
    your description I had no idea what it was supposed to mean.


    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Sat Nov 8 15:50:31 2025
    On Sat, 8 Nov 2025 10:30:22 -0500, James Kuyper wrote:

    No, the key thing he's pointing out it that it's not clear what the description you've provided means. At least, like Richard, after reading
    your description I had no idea what it was supposed to mean.

    Sure enough, I understand =) & Richard should hang in this thread,
    he's offered good ideas - a simple, clear description is needed.

    Bottom line: There's no way anyone can know what this app
    does in advance of twisting its knobs (even the description
    he offered for his own app presumes knowledge of 3rd party
    stuff after all).

    There's more work that needs to be done & speaking only for myself,
    its hardly ever going to be the case that less info presents
    a higher resolution picture & yet I press forward still.

    Thanks for your reply James I appreciate you trying to disambiguate.

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Sat Nov 8 22:00:00 2025
    On Sat, 8 Nov 2025 13:46:43 +0000, Richard Heathfield wrote:

    I don't be think I'll be replying again because I'm not sure I
    can think of another way of saying 'describe in a few words what
    your program does'.

    C'mon now Richard, its all good & lets keep it going. I'm just
    getting things together in the repl. yes lots still to do with
    descriptions but I'm getting closer see screen below. And this
    help panel still needs to be tweaked too...

    Enough out of me, still have to reply to Keith, hopefully as soon
    as Sunday evening.

    Use dot commands to control REPL or input query to scan tags

    Dot commands:

    .q Quit tinybase
    .h Display this help
    .c Clear screen
    .t Tag analytics
    .b Browse stack
    .m Display manual



    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Richard Heathfield@3:633/10 to All on Sun Nov 9 05:33:36 2025
    On 08/11/2025 14:23, Michael Sanders wrote:

    <snip>

    You're simultaneously telling me too much info
    is bad while too little is bad as well?

    Of course.

    Too much means more than is good. Too little means less than is
    good. *Both* are bad.

    Take a Vauxhall Astra with steel wheels. You want 90-110Nm to
    tighten the wheel nuts.

    Finger tight, 3-5Nm: the wheel falls off and you're driving on
    brake discs.

    Cordless impact wrench at max, say 300Nm: you'll strip the
    threads, and you'll never get the damn thing off.

    Too much means more than is good. Too little means less than is
    good. *Both* are bad. The right amount ? just enough ? is what
    works. Aim for the Goldilocks zone.

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Richard Heathfield@3:633/10 to All on Sun Nov 9 05:36:54 2025
    On 08/11/2025 15:30, James Kuyper wrote:
    On 2025-11-08 09:23, Michael Sanders wrote:
    On Sat, 8 Nov 2025 13:46:43 +0000, Richard Heathfield wrote:

    Fair enough. Here the right thing is to describe in a few words what
    your program does. Over a hundred isn't a few.

    I'd give you a hand, but after reading your 114-word description I
    was left none the wiser.

    I don't be think I'll be replying again because I'm not sure I can
    think of another way of saying 'describe in a few words what your
    program does'.

    Sorry I disagree: You're simultaneously telling me too much info
    is bad while too little is bad as well?

    No, the key thing he's pointing out it that it's not clear what the description you've provided means. At least, like Richard, after reading
    your description I had no idea what it was supposed to mean.

    Quite so.

    Nevertheless, it's perfectly true that too much is bad and too
    little is bad. "Too much" means "more than is good", and "too
    little" means "less than is good".

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Richard Heathfield@3:633/10 to All on Sun Nov 9 05:45:29 2025
    On 08/11/2025 15:50, Michael Sanders wrote:
    On Sat, 8 Nov 2025 10:30:22 -0500, James Kuyper wrote:

    No, the key thing he's pointing out it that it's not clear what the
    description you've provided means. At least, like Richard, after reading
    your description I had no idea what it was supposed to mean.

    Sure enough, I understand =) & Richard should hang in this thread,
    he's offered good ideas - a simple, clear description is needed.

    Bottom line: There's no way anyone can know what this app
    does in advance of twisting its knobs (even the description
    he offered for his own app presumes knowledge of 3rd party
    stuff after all).

    Yes, people who closed their ears in secondary school will
    struggle, but at least they'll learn enough from my description
    to learn that they don't need it!

    Can't you simply point to a README? Or just make -m the default?

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Mon Nov 10 12:57:08 2025
    On Fri, 07 Nov 2025 15:24:25 -0800, Keith Thompson wrote:

    I would remove most or all of the blank lines, just to avoid using up
    too much of the user's screen real estate. The longer your usage
    message, the more of the user's on-screen information might be lost.

    Yes sir agreed (at least in the Unix world), in the Win world might be
    a good idea to fail loudly... My thinking is it otherwise punishes those
    who need help the most.

    For a program that requires at least some command-line arguments, a very short message that points the user to a "-h" or "--help" option can be useful. Don't show a very long usage message unless the user explicitly
    asks for it. GNU coreutils rm is a decent example:

    $ rm
    rm: missing operand
    Try 'rm --help' for more information.

    That alone is worth the price of admission! Here's what you've got me
    thinking about (in a BSD/Linux world)...

    user inputs bad syntax:

    - show context sensitive help
    - offer just slightly more info with 'try fubar --help'

    And the --help screen (in my case) itself then shows a bit more info
    to the fuller documentation...

    options:
    [...]
    -m display in-built manual

    Sort of like staging in my thinking: 1 leads to 2 leads to 3,
    buy only suggested not bludgeoned in your face, subtle.

    Print error messages to stderr, usage messages (at least if
    requested via some kind of help option) to stdout. I've seem
    commands where "foo --help" prints more text than can fit on my
    screen, and "foo --help | less" shows me nothing because the output
    I asked for was sent to stderr. (This is getting a bit OS-specific,
    but it's applicable to any Unix-like system, and your use of '-'
    to introduce arguments suggest that that's what you're aiming for.)

    Yeah, all my stuff goes stderr in these cases whether fatal or not.

    I'm rethinking the whole: app -x -y -z - paradigm, really I think
    the trailing dash just confuses folks.

    Something else you might consider is how you handle the different
    modes. If I understand correctly (and I'm not at all sure I do),
    "-q", "-t", "-r", and "-m" are distinct modes, and you have
    to specify exactly one. If that's the case, you might consider
    making them subcommands, similar to the way "git" has "git commit",
    "git log", et al.

    tinybase query ...
    tinybase tag ...
    tinybase repl ...
    tinybase manual ...

    If you like, you can allow the subcommand name to be abbreviated.

    Sure enough. I've seen apps sym-linked to their 'mode names' before.
    Its good idea like '[' for test... (that one messed with me for a
    while since requires a closing ']' for chirality [i])

    Thanks Keith. Hope someone downloads your brain (other folks here too)
    some time. Lots of really great info.

    Appreciate it & lots of stupid questions/newbie stuff from me
    still left to go I'm sure of it.

    i. <https://en.wikipedia.org/wiki/Chirality>

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Mon Nov 10 16:58:46 2025
    Michael Sanders <porkchop@invalid.foo> writes:
    On Fri, 07 Nov 2025 15:24:25 -0800, Keith Thompson wrote:
    [...]
    Something else you might consider is how you handle the different
    modes. If I understand correctly (and I'm not at all sure I do),
    "-q", "-t", "-r", and "-m" are distinct modes, and you have
    to specify exactly one. If that's the case, you might consider
    making them subcommands, similar to the way "git" has "git commit",
    "git log", et al.

    tinybase query ...
    tinybase tag ...
    tinybase repl ...
    tinybase manual ...

    If you like, you can allow the subcommand name to be abbreviated.

    Sure enough. I've seen apps sym-linked to their 'mode names' before.
    Its good idea like '[' for test... (that one messed with me for a
    while since requires a closing ']' for chirality [i])

    Particularly in this case, I probably wouldn't make the subcommands
    available as standalone commands. "tinybase query" presumably makes
    sense to users, but just "query" is too vague. Even more so for
    "manual". And you would introduce a lot of opportunities for collisions
    with existing commands.

    [...]

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Tue Nov 11 23:29:36 2025
    On Sat, 8 Nov 2025 07:58:31 -0000 (UTC), Lawrence D?Oliveiro wrote:

    These days, I don?t bother. For more complex projects, I write up a
    detailed man page and include it with the program.

    I'm just going to embed mine right in the app, no fuss.

    Probably my largest such project: <https://gitlab.com/ldo/render-useful/>

    Nice!

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Tue Nov 11 23:31:12 2025
    On Mon, 10 Nov 2025 16:58:46 -0800, Keith Thompson wrote:

    Particularly in this case, I probably wouldn't make the subcommands
    available as standalone commands. "tinybase query" presumably makes
    sense to users, but just "query" is too vague. Even more so for
    "manual". And you would introduce a lot of opportunities for collisions
    with existing commands.

    Sure enough. Best left up to the user in any event.

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Wed Nov 12 00:01:11 2025
    On Fri, 07 Nov 2025 15:24:25 -0800, Keith Thompson wrote:

    $ rm
    rm: missing operand
    Try 'rm --help' for more information.

    Tentative start towards context sensitive help...

    int errmesg(int e) {
    static const char *m[] = {
    "Missing or unrecognized option",
    "-m takes no arguments or files",
    "-t does not take a query argument",
    "-t requires one or more files or stdin input",
    "-r (interactive REPL) requires a TTY",
    "-r does not take a query argument",
    "-r requires one or more files",
    "-q= requires a query argument",
    "-q= argument cannot be empty",
    "Invalid characters in query",
    "-q= requires one or more files or stdin input",
    "Unknown or unsupported option"
    };
    if (e < 0 || e >= (int)(sizeof(m)/sizeof(m[0]))) e = 0;
    fprintf(stderr,
    "tinybase: option %s\nTry tinybase -h for more info\n", m[e]);
    return e;
    }

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Wed Nov 12 00:00:40 2025
    On Fri, 07 Nov 2025 15:24:25 -0800, Keith Thompson wrote:

    $ rm
    rm: missing operand
    Try 'rm --help' for more information.

    Tentative start towards context sensitive help...

    int errmesg(int e) {
    static const char *m[] = {
    "Missing or unrecognized option",
    "-m takes no arguments or files",
    "-t does not take a query argument",
    "-t requires one or more files or stdin input",
    "-r (interactive REPL) requires a TTY",
    "-r does not take a query argument",
    "-r requires one or more files",
    "-q= requires a query argument",
    "-q= argument cannot be empty",
    "Invalid characters in query",
    "-q= requires one or more files or stdin input",
    "Unknown or unsupported option"
    };
    if (e < 0 || e >= (int)(sizeof(m)/sizeof(m[0]))) e = 0;
    fprintf(stderr,
    "tinybase: option %s\nTry tinybase -h for more info\n", m[e]);
    return e;
    }

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Wed Nov 12 00:10:12 2025
    On Wed, 12 Nov 2025 00:01:11 -0000 (UTC), Michael Sanders wrote:

    Tentative start towards context sensitive help...

    Why was this posted twice? news server is acting weird on my end...

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Wed Nov 12 03:45:10 2025
    On Tue, 11 Nov 2025 23:29:36 -0000 (UTC), Michael Sanders wrote:

    On Sat, 8 Nov 2025 07:58:31 -0000 (UTC), Lawrence D?Oliveiro wrote:

    These days, I don?t bother. For more complex projects, I write up a
    detailed man page and include it with the program.

    I'm just going to embed mine right in the app, no fuss.

    Why is it a better idea to write up proper documentation separately?

    Because a common format like a man page can be easily repurposed, e.g. to generate a nicely-typeset PDF file. Bit tricky to do that with comments or messages embedded in your code.

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Wed Nov 12 04:53:49 2025
    On Wed, 12 Nov 2025 03:45:10 -0000 (UTC), Lawrence D?Oliveiro wrote:

    Why is it a better idea to write up proper documentation separately?

    Because a common format like a man page can be easily repurposed, e.g. to generate a nicely-typeset PDF file. Bit tricky to do that with comments or messages embedded in your code.

    txt? pdf? html? man? doc? Its all good & embedding means
    its *always* with you program:

    static unsigned char help[] = {
    0x68, 0x65, 0x6C, 0x70, 0x3A,
    0x0A, 0x0A, 0x78, 0x0A, 0x79,
    0x0A, 0x78, 0x0A, 0x00
    };

    printf("%s\n", help)

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Richard Heathfield@3:633/10 to All on Wed Nov 12 07:58:20 2025
    On 11/11/2025 23:29, Michael Sanders wrote:
    On Sat, 8 Nov 2025 07:58:31 -0000 (UTC), Lawrence D?Oliveiro wrote:

    These days, I don?t bother. For more complex projects, I write up a
    detailed man page and include it with the program.

    I'm just going to embed mine right in the app, no fuss.

    That works right up until someone types

    $ man tinybase
    No manual entry for tinybase

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Wed Nov 12 11:23:50 2025
    On Wed, 12 Nov 2025 07:58:20 +0000, Richard Heathfield wrote:

    That works right up until someone types

    $ man tinybase
    No manual entry for tinybase

    And is simple to handle too. By the way, there are no man
    pages in other OS's, does that mean your app can run in
    another OS & have your documentation always at the ready?
    Or must you duplicate effort?

    Its real easy to fall into the trap of thinking Linux is
    the only ball game in town, I see Windows/Apple users
    do it themselves all the time - not so tinybase.

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Nov 13 05:54:42 2025
    On Wed, 12 Nov 2025 11:23:50 -0000 (UTC), Michael Sanders wrote:

    By the way, there are no man pages in other OS's ...

    All the POSIXish ones have man pages. What else is there?

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Nov 13 05:55:28 2025
    On Wed, 12 Nov 2025 04:53:49 -0000 (UTC), Michael Sanders wrote:

    On Wed, 12 Nov 2025 03:45:10 -0000 (UTC), Lawrence D?Oliveiro wrote:

    Why is it a better idea to write up proper documentation separately?

    Because a common format like a man page can be easily repurposed, e.g.
    to generate a nicely-typeset PDF file. Bit tricky to do that with
    comments or messages embedded in your code.

    txt? pdf? html? man? doc?

    They can all be generated from groff -man.

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Thu Nov 13 11:41:42 2025
    On Thu, 13 Nov 2025 05:55:28 -0000 (UTC), Lawrence D?Oliveiro wrote:

    txt? pdf? html? man? doc?

    They can all be generated from groff -man.

    And then only under Linux/BSD, not 2% of your potential audience.
    And man pages can't link to other referenced citations. Certainly
    I would say man pages are necessary but not very great otherwise.
    HTML or PDF seem to be a better choice in lots of cases. Imagine
    a PDF for automotive parts where an image is shown that looks like
    that sensor you need for your car, how do man pages deal with that?

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael Sanders@3:633/10 to All on Sat Nov 15 01:55:57 2025
    On Fri, 07 Nov 2025 15:24:25 -0800, Keith Thompson wrote:


    I would remove most or all of the blank lines...

    It does look better...

    Usage: tinybase [ -s=patterns... | -t | -r | -m | -h ] [ files... ]

    Synopsis: Tag based search tool

    Options:

    -s scan files for tags (wildcards *? allowed)
    example: tinybase -s='pattern1, pattern2' files
    -t display tag analytics for files
    -r interactive shell for pattern scans of files
    -m display user manual
    -h display this help screen

    --
    :wq
    Mike Sanders

    --- PyGate Linux v1.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)