On 24/03/2016 22:27, Ross Berteig wrote:
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?
Well this was/is the existing code/behaviour for wiki pages as well as tech notes, so this is a more general question than just for tech notes (personal opinion is yes it should do the same as the GUI (modulo your next suggestion)
Should the CLI allow -M to take friendly names like "plain", "markdown", and "wiki" which get expanded to their full equivalent?
I think this will would be more friendly
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?
A empty string for the pagename (i.e., passing "") or a string which just blanks will result in no C card being created.
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.
Personally I feel that as a tech note with no comment appears on the timeline as just the link to the tech note, this is not something that is either terribly useful or to be encouraged. Hence I would be happy for the leaving this aspect of the CLI as it is :)
-- Dave _______________________________________________ fossil-dev mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/fossil-dev
