Skip to content

Cli option hierachy #306

@thompson-tomo

Description

@thompson-tomo

Currently we have a range of cli options but it would be useful if naming and approach was consistent.

The current options are:

value type cli argument cli alias
boolean help h
boolean notitle T
boolean stdout s
boolean all a
boolean update-only u
boolean dryrun d
string title t
string maxlevel m
string minlevel n
string entryprefix

Thinking about it would be nice to have hierachy to the settings as such I would propose we aim for something along the lines of the below proposal.

file option value type cli argument cli alias comment
boolean help h
boolean stdout s
boolean update-only u
boolean dryrun d
enum output-mode o options of toc, complete (default)
heading.level.max int heading-level-max maxlevel, m
heading.level.min int heading-level-min minlevel, n default 1
heading.source enum heading-source all options of all, after (default)
toc.items.format string toc-items-format - options of ordered, unordered (default)
toc.items.indenting.width int toc-items-indenting-width - default 2
toc.items.indenting.type enum toc-items-indenting-type - default space
toc.items.min int toc-items-min mintocitems default 1
toc.items.padding.after int toc-items-padding-after - default 1
toc.items.padding.before int toc-items-padding-before - default 1
toc.items.style string toc-items-style entryprefix only applies to unordered format
toc.location enum toc-location - options of top (default), after
toc.padding.after int toc-padding-after - default 1
toc.padding.before int toc-padding-before - default 1
toc.title.content string toc-title-content -
toc.title.padding.after int toc-title-padding-after - default 0
toc.title.padding.before int toc-title-padding-before - default 0
toc.title.remove boolean toc-title-remove T, notitle default false

The key thing is cli arguments & file properties should be able to be automatically mapped between one another.

The idea here would be that each word in the string settings corresponds to an object in a config file.

Aliases would not be used for settings which impacts the toc generated but rather limited to only the options impacting how it runs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions