Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto generate cli docs #71

Merged
merged 74 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from 73 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
7a2abdf
doc tool
feedmeapples Nov 28, 2022
3e74d32
Merge remote-tracking branch 'origin/main' into auto-generate-cli-docs
DJSanti Jan 9, 2023
ec461aa
wrote something. asking for advice
DJSanti Jan 9, 2023
32c6209
moved around some things. committing basics
DJSanti Jan 9, 2023
7473f36
framework is there.
DJSanti Jan 9, 2023
4cf0337
simulate creating folders
DJSanti Jan 9, 2023
474228f
final commit for today.
DJSanti Jan 9, 2023
2abf4a2
trying out directory creation
DJSanti Jan 10, 2023
8de3482
folders created. now for files
DJSanti Jan 10, 2023
d866933
made files and directories for level 2 H's
DJSanti Jan 10, 2023
9abe264
edit
DJSanti Jan 10, 2023
d1fa1e6
file permissions updated
DJSanti Jan 10, 2023
d52aa24
found correct permissions
DJSanti Jan 10, 2023
164bfc0
Merge remote-tracking branch 'origin/main' into auto-generate-cli-docs
DJSanti Jan 10, 2023
5c01fe1
keeping up with main edits
DJSanti Jan 10, 2023
a993532
renamed files
DJSanti Jan 10, 2023
08dcb2d
tertiary files created and written to
DJSanti Jan 10, 2023
bcf7692
tertiary files
DJSanti Jan 10, 2023
1d4e631
headers for each file
DJSanti Jan 10, 2023
ace027c
adds error messages
rachfop Jan 10, 2023
d2ca3ee
basic formatting achieved
DJSanti Jan 10, 2023
2851825
separates aliases from terms
DJSanti Jan 10, 2023
d4d4dc3
minor fix
DJSanti Jan 10, 2023
c2f5632
minor change to trim space
DJSanti Jan 11, 2023
f0ba227
trimspace
DJSanti Jan 11, 2023
445d1e3
Merge remote-tracking branch 'origin/main' into auto-generate-cli-docs
DJSanti Jan 17, 2023
76b4fd4
edited Temporal term grammar
DJSanti Jan 17, 2023
8aba5f5
grammar
DJSanti Jan 17, 2023
8f274de
UsageText added
DJSanti Jan 18, 2023
65024c5
UsageText formatting
DJSanti Jan 18, 2023
1327674
frontmatter template created
DJSanti Jan 18, 2023
e531a54
template edited.
DJSanti Jan 18, 2023
87135d4
generated front matter
DJSanti Jan 19, 2023
8ffb26e
regenerated + moving definitions
DJSanti Jan 19, 2023
2ea0499
defs and generation
DJSanti Jan 19, 2023
7e28a83
pre-demo commit
DJSanti Jan 19, 2023
fa30ed6
links added
DJSanti Jan 19, 2023
d56b1ae
retooling descriptions
DJSanti Jan 19, 2023
15698f6
links
DJSanti Jan 19, 2023
0585b03
partially refactored
DJSanti Jan 20, 2023
e9df959
refactoring in progress
DJSanti Jan 20, 2023
dd39439
point before I go mess with things
DJSanti Jan 20, 2023
dfad296
directory function
DJSanti Jan 20, 2023
10c9e08
added isOptions bool
DJSanti Jan 20, 2023
382df9a
makeFile func, deleteExisting
DJSanti Jan 20, 2023
968eecc
makeFile restructure
DJSanti Jan 20, 2023
66f6ff1
precautionary commit
DJSanti Jan 20, 2023
727235d
cmd-options folder generating
DJSanti Jan 20, 2023
316264a
now
DJSanti Jan 20, 2023
67b7b75
cmd-options files initialized
DJSanti Jan 20, 2023
1f9acdf
cmd-files have definitions
DJSanti Jan 20, 2023
9eeb72e
regen
DJSanti Jan 24, 2023
a5fb609
Merge branch 'main' into auto-generate-cli-docs
DJSanti Jan 24, 2023
3f758fa
moving usagetext to string templates
DJSanti Jan 24, 2023
bcd1248
more usagetext moved
DJSanti Jan 25, 2023
2c8b79b
variables added
DJSanti Jan 25, 2023
abcef26
Merge branch 'main' into auto-generate-cli-docs
DJSanti Jan 25, 2023
1970a73
almost through usagetxt
DJSanti Jan 25, 2023
ada9099
usagetxt
DJSanti Jan 25, 2023
5752d3e
changes from main
DJSanti Jan 25, 2023
938a263
EOD doc generation
DJSanti Jan 25, 2023
b6ef7c7
improved cmd-options list for docusaurus
DJSanti Jan 26, 2023
16f5833
more spacing issues
DJSanti Jan 26, 2023
d97dc7c
pretty much all there
DJSanti Jan 26, 2023
0e02a3c
remove generated docs
DJSanti Jan 30, 2023
5bb77b8
minor change
DJSanti Feb 1, 2023
290d3a0
changed %v to %s
DJSanti Feb 2, 2023
8d4dfd3
Merge remote-tracking branch 'origin/main' into auto-generate-cli-docs
DJSanti Feb 2, 2023
d02c410
address ci failure
feedmeapples Feb 2, 2023
fd90237
gitignore docs
feedmeapples Feb 2, 2023
c6703f4
more varaibles created from flags
DJSanti Feb 2, 2023
c649f81
flag variables created
DJSanti Feb 2, 2023
da268ef
reviewed usagetext
DJSanti Feb 2, 2023
3480934
changed links
DJSanti Feb 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ __debug_bin
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# ./cmd/docs output
docs

# Dependency directories (remove the comment below to include it)
# vendor/

Expand Down
28 changes: 15 additions & 13 deletions activity/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,38 @@ func NewActivityCommands() []*cli.Command {
return []*cli.Command{
{
Name: "complete",
Usage: "Complete an activity",
Usage: common.CompleteActivityDefinition,
UsageText: common.CompleteActivityUsageText,
Flags: []cli.Flag{
&cli.StringFlag{
Name: common.FlagWorkflowID,
Aliases: common.FlagWorkflowIDAlias,
Usage: "Workflow Id",
Usage: common.FlagWorkflowIDDefinition,
Required: true,
Category: common.CategoryMain,
},
&cli.StringFlag{
Name: common.FlagRunID,
Aliases: common.FlagRunIDAlias,
Usage: "Run Id",
Usage: common.FlagRunIDDefinition,
Required: true,
Category: common.CategoryMain,
},
&cli.StringFlag{
Name: common.FlagActivityID,
Usage: "The Activity Id to complete",
Usage: common.FlagActivityCompleteDefinition,
Required: true,
Category: common.CategoryMain,
},
&cli.StringFlag{
Name: common.FlagResult,
Usage: "Set the result value of completion",
Usage: common.FlagResultDefinition,
Required: true,
Category: common.CategoryMain,
},
&cli.StringFlag{
Name: common.FlagIdentity,
Usage: "Specify operator's identity",
Usage: common.FlagIdentityDefinition,
Required: true,
Category: common.CategoryMain,
},
Expand All @@ -50,43 +51,44 @@ func NewActivityCommands() []*cli.Command {
},
{
Name: "fail",
Usage: "Fail an activity",
Usage: common.FailActivityDefinition,
UsageText: common.FailActivityUsageText,
Flags: []cli.Flag{
&cli.StringFlag{
Name: common.FlagWorkflowID,
Aliases: common.FlagWorkflowIDAlias,
Usage: "Workflow Id",
Usage: common.FlagWorkflowIDDefinition,
Required: true,
Category: common.CategoryMain,
},
&cli.StringFlag{
Name: common.FlagRunID,
Aliases: common.FlagRunIDAlias,
Usage: "Run Id",
Usage: common.FlagRunIDDefinition,
Required: true,
Category: common.CategoryMain,
},
&cli.StringFlag{
Name: common.FlagActivityID,
Usage: "The Activity Id to fail",
Usage: common.FlagActivityFailDefinition,
Required: true,
Category: common.CategoryMain,
},
&cli.StringFlag{
Name: common.FlagReason,
Usage: "Reason to fail the Activity",
Usage: common.FlagReasonDefinition,
Required: true,
Category: common.CategoryMain,
},
&cli.StringFlag{
Name: common.FlagDetail,
Usage: "Detail to fail the Activity",
Usage: common.FlagDetailDefinition,
Required: true,
Category: common.CategoryMain,
},
&cli.StringFlag{
Name: common.FlagIdentity,
Usage: "Specify operator's identity",
Usage: common.FlagIdentityDefinition,
Required: true,
Category: common.CategoryMain,
},
Expand Down
28 changes: 15 additions & 13 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func serverCommands(defaultCfg *sconfig.Config) []*cli.Command {
return []*cli.Command{
{
Name: "server",
Usage: "Commands for managing Temporal server",
Usage: "Commands for managing the Temporal Server.",
Subcommands: server.NewServerCommands(defaultCfg),
},
}
Expand All @@ -97,62 +97,64 @@ func serverCommands(defaultCfg *sconfig.Config) []*cli.Command {
var clientCommands = []*cli.Command{
{
Name: "workflow",
Usage: "Operations on Workflows",
Usage: common.WorkflowDefinition,
Subcommands: workflow.NewWorkflowCommands(),
},
{
Name: "activity",
Usage: "Operations on Activities of Workflows",
Usage: common.ActivityDefinition,
Subcommands: activity.NewActivityCommands(),
},
{
Name: "task-queue",
Usage: "Operations on Task Queues",
Usage: common.TaskQueueDefinition,
Subcommands: taskqueue.NewTaskQueueCommands(),
},
{
Name: "schedule",
Usage: "Operations on Schedules",
Usage: common.ScheduleDefinition,
UsageText: common.ScheduleUsageText,
Subcommands: schedule.NewScheduleCommands(),
},

{
Name: "batch",
Usage: "Operations on Batch jobs. Use workflow commands with --query flag to start batch jobs",
Usage: common.BatchDefinition,
UsageText: common.BatchUsageText,
Subcommands: batch.NewBatchCommands(),
},
{
Name: "operator",
Usage: "Operation on Temporal server",
Usage: common.OperatorDefinition,
UsageText: common.OperatorUsageText,
Subcommands: []*cli.Command{
{
Name: "namespace",
Usage: "Operations on namespaces",
Usage: common.NamespaceDefinition,
Subcommands: namespace.NewNamespaceCommands(),
},
{
Name: "search-attribute",
Usage: "Operations on search attributes",
Usage: common.SearchAttributeDefinition,
Subcommands: searchattribute.NewSearchAttributeCommands(),
},
{
Name: "cluster",
Usage: "Operations on a Temporal cluster",
Usage: common.ClusterDefinition,
Subcommands: cluster.NewClusterCommands(),
},
},
},
{
Name: "env",
Usage: "Manage client environment configurations",
Usage: common.EnvDefinition,
Subcommands: env.NewEnvCommands(),
},
}

var completionCommands = []*cli.Command{
{
Name: "completion",
Usage: "Output shell completion code for the specified shell (zsh, bash)",
Usage: "Output shell completion code for the specified shell (zsh, bash).",
Subcommands: completion.NewCompletionCommands(),
},
}
15 changes: 9 additions & 6 deletions batch/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ func NewBatchCommands() []*cli.Command {
return []*cli.Command{
{
Name: "describe",
Usage: "Describe a batch operation job",
Usage: common.DescribeBatchJobDefinition,
UsageText: common.DescribeBatchUsageText,
Flags: append([]cli.Flag{
&cli.StringFlag{
Name: common.FlagJobID,
Usage: "Batch Job Id",
Usage: common.FlagJobIDDefinition,
Required: true,
Category: common.CategoryMain,
},
Expand All @@ -24,7 +25,8 @@ func NewBatchCommands() []*cli.Command {
},
{
Name: "list",
Usage: "List batch operation jobs",
Usage: common.ListBatchJobsDefinition,
UsageText: common.ListBatchUsageText,
Flags: common.FlagsForPaginationAndRendering,
ArgsUsage: " ",
Action: func(c *cli.Context) error {
Expand All @@ -33,17 +35,18 @@ func NewBatchCommands() []*cli.Command {
},
{
Name: "terminate",
Usage: "Stop a batch operation job",
Usage: common.TerminateBatchJobDefinition,
UsageText: common.TerminateBatchUsageText,
Flags: []cli.Flag{
&cli.StringFlag{
Name: common.FlagJobID,
Usage: "Batch Job Id",
Usage: common.FlagJobIDDefinition,
Required: true,
Category: common.CategoryMain,
},
&cli.StringFlag{
Name: common.FlagReason,
Usage: "Reason to stop the batch job",
Usage: common.FlagReasonBatchDefinition,
Required: true,
Category: common.CategoryMain,
},
Expand Down
28 changes: 17 additions & 11 deletions cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ func NewClusterCommands() []*cli.Command {
return []*cli.Command{
{
Name: "health",
Usage: "Check health of frontend service",
Usage: common.HealthDefinition,
UsageText: common.HealthUsageText,
Action: func(c *cli.Context) error {
return HealthCheck(c)
},
},
{
Name: "describe",
Usage: "Show information about the cluster",
Usage: common.DescribeDefinition,
UsageText: common.ClusterDescribeUsageText,
ArgsUsage: " ",
Flags: []cli.Flag{
&cli.StringFlag{
Expand All @@ -29,7 +31,7 @@ func NewClusterCommands() []*cli.Command {
},
&cli.StringFlag{
Name: output.FlagFields,
Usage: "customize fields to print. Set to 'long' to automatically print more of main fields",
Usage: common.FlagFieldsDefinition,
Category: common.CategoryDisplay,
},
},
Expand All @@ -39,7 +41,8 @@ func NewClusterCommands() []*cli.Command {
},
{
Name: "system",
Usage: "Show information about the system and capabilities",
Usage: common.SystemDefinition,
UsageText: common.ClusterSystemUsageText,
ArgsUsage: " ",
Flags: []cli.Flag{
&cli.StringFlag{
Expand All @@ -51,7 +54,7 @@ func NewClusterCommands() []*cli.Command {
},
&cli.StringFlag{
Name: output.FlagFields,
Usage: "customize fields to print. Set to 'long' to automatically print more of main fields",
Usage: common.FlagFieldsDefinition,
Category: common.CategoryDisplay,
},
},
Expand All @@ -61,17 +64,18 @@ func NewClusterCommands() []*cli.Command {
},
{
Name: "upsert",
Usage: "Add or update a remote cluster",
Usage: common.UpsertDefinition,
UsageText: common.ClusterUpsertUsageText,
ArgsUsage: " ",
Flags: []cli.Flag{
&cli.StringFlag{
Name: common.FlagClusterAddress,
Usage: "Frontend address of the remote cluster",
Usage: common.FlagClusterAddressDefinition,
Category: common.CategoryMain,
},
&cli.BoolFlag{
Name: common.FlagClusterEnableConnection,
Usage: "Enable cross cluster connection",
Usage: common.FlagClusterEnableConnectionDefinition,
Category: common.CategoryMain,
},
},
Expand All @@ -81,7 +85,8 @@ func NewClusterCommands() []*cli.Command {
},
{
Name: "list",
Usage: "List all remote clusters",
Usage: common.ListDefinition,
UsageText: common.ClusterListUsageText,
ArgsUsage: " ",
Flags: common.FlagsForPaginationAndRendering,
Action: func(c *cli.Context) error {
Expand All @@ -90,12 +95,13 @@ func NewClusterCommands() []*cli.Command {
},
{
Name: "remove",
Usage: "Remove a remote cluster",
Usage: common.RemoveDefinition,
UsageText: common.ClusterRemoveUsageText,
ArgsUsage: " ",
Flags: []cli.Flag{
&cli.StringFlag{
Name: common.FlagName,
Usage: "Frontend address of the remote cluster",
Usage: common.FlagNameDefinition,
Required: true,
Category: common.CategoryMain,
},
Expand Down
Loading