Skip to content

Commit

Permalink
style(cmd): Update CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
jshlbrd committed Oct 28, 2024
1 parent 90bb6dd commit 12da767
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
3 changes: 2 additions & 1 deletion cmd/substation/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const (
}`

// confDemo is a demo configuration for AWS CloudTrail.
confDemo = `local sub = std.extVar('sub');
confDemo = `// Every config must import the Substation library.
local sub = std.extVar('sub');
{
transforms: [
Expand Down
6 changes: 3 additions & 3 deletions cmd/substation/playground.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ func init() {
}

var playgroundCmd = &cobra.Command{
Use: "playground",
Use: "play",
Short: "start playground",
Long: `'substation playground' starts a local HTTP server for testing Substation configurations.`,
Long: `'substation play' starts a local instance of the Substation playground.`,
RunE: runPlayground,
}

Expand Down Expand Up @@ -124,7 +124,7 @@ func handleIndex(w http.ResponseWriter, r *http.Request) {

// If shared data is present, don't include environment variables
if sharedData == "" {
data.DefaultEnv = "# Add environment variables here, one per line\n# Example: KEY=VALUE"
data.DefaultEnv = "# Example: KEY=VALUE"
}

tmpl := template.Must(template.New("index").Parse(playgroundHTML))
Expand Down
13 changes: 6 additions & 7 deletions cmd/substation/playground.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,7 @@
<button class="secondary-button" onclick="shareSubstation()">Share</button>
</div>
<p class="subtext">
Run your configuration, test it, or try a demo.
<a href="https://github.com/brexhq/substation/tree/main/examples" target="_blank" class="examples-link">View examples</a>
Run, test, or share a config. New to Substation? Try the demo to see how it works. Need inspiration? <a href="https://github.com/brexhq/substation/tree/main/examples" target="_blank" class="examples-link">View more examples here</a>.
</p>
</div>
</div>
Expand All @@ -330,7 +329,7 @@
<h2>Configuration</h2>
<button class="secondary-button" onclick="formatJsonnet()"><i class="fas fa-broom"></i></button>
</div>
<p class="subtext">Configure the transformations to be applied to the input event.</p>
<p class="subtext">Configure the transforms.</p>
<div class="editor-container" id="config"></div>
</section>
<section class="right-column">
Expand All @@ -342,7 +341,7 @@
<option value="json">JSON</option>
</select>
</div>
<p class="subtext">Paste the message data to be processed by Substation here.</p>
<p class="subtext">Add message data.</p>
<div class="editor-container" id="input"></div>
</div>
<div class="editor-section">
Expand All @@ -353,7 +352,7 @@
<option value="json">JSON</option>
</select>
</div>
<p class="subtext">The processed message data will appear here after running.</p>
<p class="subtext">See the results.</p>
<div class="editor-container" id="output"></div>
</div>
</section>
Expand All @@ -366,7 +365,7 @@
<h2>Environment Variables</h2>
<span class="close" onclick="closeEnvModal()">&times;</span>
</div>
<p class="subtext">Add environment variables here, one per line (KEY=VALUE). These will not be included when sharing.</p>
<p class="subtext">Add environment variables, one per line (KEY=VALUE). These are not included when sharing the config.</p>
<div class="editor-container" id="env"></div>
<div class="modal-footer">
<button class="primary-button" onclick="closeEnvModal()">Save & Close</button>
Expand Down Expand Up @@ -518,7 +517,7 @@
.then(data => {
configEditor.setValue(data.config);
inputEditor.setValue(data.input);
outputEditor.setValue('// Run the demo to see the output');
outputEditor.setValue('// Click the Run button to see the results!');
})
.catch(error => {
console.error('Error fetching demo:', error);
Expand Down
2 changes: 1 addition & 1 deletion cmd/substation/tap.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

func init() {
rootCmd.AddCommand(tapCmd)
tapCmd.PersistentFlags().String("aws-kinesis-data-stream", "", "ARN of the Kinesis Data Stream to tap")
tapCmd.PersistentFlags().String("aws-kinesis-data-stream", "", "arn of the aws kinesis data stream to tap")
tapCmd.PersistentFlags().String("offset", "latest", "the offset to read from (earliest, latest)")
tapCmd.PersistentFlags().StringToString("ext-str", nil, "set external variables")
tapCmd.Flags().SortFlags = false
Expand Down

0 comments on commit 12da767

Please sign in to comment.