I've been thinking about the support for CLI access to technotes
introduced in the (still a work in progress) technoteattachcli branch.
A couple of things leap to mind that probably deserve some hashing from
a larger pool of minds.
The easy one first. The (now reworded) help text for fossil wiki create:
fossil wiki (create|commit) PAGENAME ?FILE? ?OPTIONS?
Create a new or commit changes to an existing wiki page or
technote from FILE or from standard input. PAGENAME is the
name of the wiki entry or the timeline comment of the
technote.
Options:
-M|--mimetype TEXT-FORMAT The mime type of the update.
Defaults to the type used by
the previous version of the
page, or text/x-fossil-wiki.
-t|--technote DATETIME Specifies the timestamp of
the technote to be created or
updated.
--technote-tags TAGS The set of tags for a technote.
--technote-bgcolor COLOR The color used for the technote
on the timeline.
The help text should document what mimetypes are intended to be used,
especially since it seems to expect a full mimetype as its argument.
The GUI passes the mimetype selection through the function
wiki_filter_mimetypes() to limit it to one of "text/x-markdown",
"text/plain", or "text/x-fossil-wiki". If any other mimetype was
specified, it is replaced with "text/x-fossil-wiki".
Should the CLI do that too?
Should the CLI allow -M to take friendly names like "plain", "markdown",
and "wiki" which get expanded to their full equivalent?
The slightly more difficult question has to do with the treatment of the
PAGENAME argument when the -t|--technote option is present. With that
option, the command creates a technote instead of a wiki page. The
PAGENAME argument is used (reasonably, IMHO) as the Timeline Comment for
the technote, and the optional FILE argument (or stdin) is used for the
note content.
The internal representation of a technote does not require that a
Timeline Comment (a C card in the artifact) be specified. The C card is
completely optional. Should the PAGENAME argument be optional too?
As an argument against that idea, if it were optional, then it could
only be omitted when the FILE argument is also omitted. That narrows the
possible use cases substantially.
--
Ross Berteig r...@cheshireeng.com
Cheshire Engineering Corp. http://www.CheshireEng.com/
+1 626 303 1602
_______________________________________________
fossil-dev mailing list
fossil-dev@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/fossil-dev