Merge branch 'main' into fulghum/dropped-check-constraints-2672

This commit is contained in:
Jason Fulghum
2022-01-31 09:07:59 -08:00
5 changed files with 24 additions and 10 deletions

View File

@@ -41,7 +41,6 @@ var cmdMdDocTempl = "## `{{.Command}}`\n\n" +
"{{.Options}}\n\n"
func (cmdDoc CommandDocumentation) CmdDocToMd() (string, error) {
// Accumulate the options and args in a string
options := ""
if len(cmdDoc.ArgParser.Supported) > 0 || len(cmdDoc.ArgParser.ArgListHelp) > 0 {
@@ -187,8 +186,8 @@ var MarkdownFormat = docFormat{"`<", ">`", "`", "`"}
// Shell help output format
var CliFormat = docFormat{"<", ">", "<b>", "</b>"}
// Special format for the synopsis which is rendered inside raw HTML in markdown
var SynopsisMarkdownFormat = docFormat{"&lt;", "&gt;", "`", "`"}
// Synopsis is an mdx format, but already inside a code block
var SynopsisMarkdownFormat = docFormat{"<", ">", "`", "`"}
func transformSynopsisToMarkdown(commandStr string, synopsis []string) string {
if len(synopsis) == 0 {

View File

@@ -27,7 +27,12 @@ import (
)
const (
fileParamName = "file"
fileParamName = "file"
cliMdDocHeader = "" +
"---\n" +
"title: CLI\n" +
"---\n\n" +
"# CLI\n\n"
)
type DumpDocsCmd struct {
@@ -88,6 +93,12 @@ func (cmd *DumpDocsCmd) Exec(ctx context.Context, commandStr string, args []stri
return 1
}
_, err = wr.Write([]byte(cliMdDocHeader))
if err != nil {
cli.PrintErrln(err.Error())
return 1
}
err = cmd.dumpDocs(wr, cmd.DoltCommand.Name(), cmd.DoltCommand.Subcommands)
if err != nil {

View File

@@ -43,7 +43,7 @@ Running dolt init in an already initialized directory will fail.
`,
Synopsis: []string{
//`[{{.LessThan}}options{{.GreaterThan}}] [{{.LessThan}}path{{.GreaterThan}}]`,
"",
},
}

View File

@@ -33,10 +33,14 @@ import (
)
var schExportDocs = cli.CommandDocumentationContent{
ShortDesc: "Exports a table's schema.",
LongDesc: "",
ShortDesc: "Exports table schemas as SQL DDL statements.",
LongDesc: "Exports table schemas as SQL DDL statements, which can then be executed to recreate tables." + `
If ` + "`table`" + ` is given, only that table's schema will be exported, otherwise all table schemas will be exported.
If ` + "`file`" + ` is given, the exported schemas will be written to that file, otherwise they will be written to standard out.`,
Synopsis: []string{
"{{.LessThan}}table{{.GreaterThan}} {{.LessThan}}file{{.GreaterThan}}",
"[{{.LessThan}}table{{.GreaterThan}}] [{{.LessThan}}file{{.GreaterThan}}]",
},
}
@@ -61,7 +65,7 @@ func (cmd ExportCmd) CreateMarkdown(wr io.Writer, commandStr string) error {
func (cmd ExportCmd) ArgParser() *argparser.ArgParser {
ap := argparser.NewArgParser()
ap.ArgListHelp = append(ap.ArgListHelp, [2]string{"table", "table whose schema is being exported."})
ap.ArgListHelp = append(ap.ArgListHelp, [2]string{"file", "the file that the schema will be written to."})
ap.ArgListHelp = append(ap.ArgListHelp, [2]string{"file", "the file to which the schema will be exported."})
return ap
}

View File

@@ -68,7 +68,7 @@ where source_field_name is the name of a field in the file being imported and de
`
var schImportDocs = cli.CommandDocumentationContent{
ShortDesc: "Creates a new table with an inferred schema.",
ShortDesc: "Creates or updates a table by inferring a schema from a file containing sample data.",
LongDesc: `If {{.EmphasisLeft}}--create | -c{{.EmphasisRight}} is given the operation will create {{.LessThan}}table{{.GreaterThan}} with a schema that it infers from the supplied file. One or more primary key columns must be specified using the {{.EmphasisLeft}}--pks{{.EmphasisRight}} parameter.
If {{.EmphasisLeft}}--update | -u{{.EmphasisRight}} is given the operation will update {{.LessThan}}table{{.GreaterThan}} any additional columns, or change the types of columns based on the file supplied. If the {{.EmphasisLeft}}--keep-types{{.EmphasisRight}} parameter is supplied then the types for existing columns will not be modified, even if they differ from what is in the supplied file.