mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +08:00
Make config backwards-compatible
This commit is contained in:
parent
262853f6c0
commit
2f44bcb6be
39
README.md
39
README.md
@ -603,26 +603,25 @@ USAGE:
|
||||
mark [global options] [arguments...]
|
||||
|
||||
GLOBAL OPTIONS:
|
||||
--files value, -f value use specified markdown file(s) for converting to html. Supports file globbing patterns (needs to be quoted). [$MARK_FILES]
|
||||
--compile-only show resulting HTML and don't update Confluence page content. (default: false) [$MARK_COMPILE_ONLY]
|
||||
--dry-run resolve page and ancestry, show resulting HTML and exit. (default: false) [$MARK_DRY_RUN]
|
||||
--edit-lock, -k lock page editing to current user only to prevent accidental manual edits over Confluence Web UI. (default: false) [$MARK_EDIT_LOCK]
|
||||
--drop-h1 don't include H1 headings in Confluence output. (default: false) [$MARK_H1_DROP]
|
||||
--title-from-h1 extract page title from a leading H1 heading. If no H1 heading on a page exists, then title must be set in the page metadata. (default: false) [$MARK_H1_TITLE]
|
||||
--minor-edit don't send notifications while updating Confluence page. (default: false) [$MARK_MINOR_EDIT]
|
||||
--color value display logs in color. Possible values: auto, never. (default: "auto") [$MARK_COLOR]
|
||||
--debug enable debug logs. (default: false) [$MARK_DEBUG]
|
||||
--trace enable trace logs. (default: false) [$MARK_TRACE]
|
||||
--username value, -u value use specified username for updating Confluence page. [$MARK_USERNAME]
|
||||
--password value, -p value use specified token for updating Confluence page. Specify - as password to read password from stdin, or your Personal access token. Username is not mandatory if personal access token is provided. For more info please see: https://developer.atlassian.com/server/confluence/confluence-server-rest-api/#authentication. [$MARK_PASSWORD]
|
||||
--target-url value, -l value edit specified Confluence page. If -l is not specified, file should contain metadata (see above). [$MARK_TARGET_URL]
|
||||
--base-url value, -b value base URL for Confluence. Alternative option for base_url config field. [$MARK_BASE_URL]
|
||||
--config value, -c value use the specified configuration file. (default: "/home/mruger/.config/mark") [$MARK_CONFIG]
|
||||
--ci run on CI mode. It won't fail if files are not found. (default: false) [$MARK_CI]
|
||||
--space value use specified space key. If the space key is not specified, it must be set in the page metadata. [$MARK_SPACE]
|
||||
--help, -h show help
|
||||
--version, -v print the version
|
||||
|
||||
--files value, -f value use specified markdown file(s) for converting to html. Supports file globbing patterns (needs to be quoted). [$MARK_FILES]
|
||||
--compile-only show resulting HTML and don't update Confluence page content. (default: false) [$MARK_COMPILE_ONLY]
|
||||
--dry-run resolve page and ancestry, show resulting HTML and exit. (default: false) [$MARK_DRY_RUN]
|
||||
--edit-lock, -k lock page editing to current user only to prevent accidental manual edits over Confluence Web UI. (default: false) [$MARK_EDIT_LOCK]
|
||||
--drop-h1, --h1_drop don't include H1 headings in Confluence output. (default: false) [$MARK_H1_DROP]
|
||||
--title-from-h1, --h1_title extract page title from a leading H1 heading. If no H1 heading on a page exists, then title must be set in the page metadata. (default: false) [$MARK_H1_TITLE]
|
||||
--minor-edit don't send notifications while updating Confluence page. (default: false) [$MARK_MINOR_EDIT]
|
||||
--color value display logs in color. Possible values: auto, never. (default: "auto") [$MARK_COLOR]
|
||||
--debug enable debug logs. (default: false) [$MARK_DEBUG]
|
||||
--trace enable trace logs. (default: false) [$MARK_TRACE]
|
||||
--username value, -u value use specified username for updating Confluence page. [$MARK_USERNAME]
|
||||
--password value, -p value use specified token for updating Confluence page. Specify - as password to read password from stdin, or your Personal access token. Username is not mandatory if personal access token is provided. For more info please see: https://developer.atlassian.com/server/confluence/confluence-server-rest-api/#authentication. [$MARK_PASSWORD]
|
||||
--target-url value, -l value edit specified Confluence page. If -l is not specified, file should contain metadata (see above). [$MARK_TARGET_URL]
|
||||
--base-url value, -b value, --base_url value base URL for Confluence. Alternative option for base_url config field. [$MARK_BASE_URL]
|
||||
--config value, -c value use the specified configuration file. (default: "/home/mruger/.config/mark") [$MARK_CONFIG]
|
||||
--ci run on CI mode. It won't fail if files are not found. (default: false) [$MARK_CI]
|
||||
--space value use specified space key. If the space key is not specified, it must be set in the page metadata. [$MARK_SPACE]
|
||||
--help, -h show help
|
||||
--version, -v print the version
|
||||
```
|
||||
|
||||
You can store user credentials in the configuration file, which should be
|
||||
|
4
main.go
4
main.go
@ -56,12 +56,14 @@ var flags = []cli.Flag{
|
||||
altsrc.NewBoolFlag(&cli.BoolFlag{
|
||||
Name: "drop-h1",
|
||||
Value: false,
|
||||
Aliases: []string{"h1_drop"},
|
||||
Usage: "don't include H1 headings in Confluence output.",
|
||||
EnvVars: []string{"MARK_H1_DROP"},
|
||||
}),
|
||||
altsrc.NewBoolFlag(&cli.BoolFlag{
|
||||
Name: "title-from-h1",
|
||||
Value: false,
|
||||
Aliases: []string{"h1_title"},
|
||||
Usage: "extract page title from a leading H1 heading. If no H1 heading on a page exists, then title must be set in the page metadata.",
|
||||
EnvVars: []string{"MARK_H1_TITLE"},
|
||||
}),
|
||||
@ -112,7 +114,7 @@ var flags = []cli.Flag{
|
||||
}),
|
||||
altsrc.NewStringFlag(&cli.StringFlag{
|
||||
Name: "base-url",
|
||||
Aliases: []string{"b"},
|
||||
Aliases: []string{"b", "base_url"},
|
||||
Value: "",
|
||||
Usage: "base URL for Confluence. Alternative option for base_url config field.",
|
||||
EnvVars: []string{"MARK_BASE_URL"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user