You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hugo/content/docs/learn/minilogo/customizing_cli.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Once you have a grammar and some validation in place, you may want to start conf
15
15
16
16
## About the Command Line Interface
17
17
18
-
If you've been using a language built with the yeoman generator for Langium, you should be able to find your CLI defined in **src/cli/index.ts**. This file describes the general layout of your languages's command line interface, and lets you register specific commands. By default, you're provided with a single command for your CLI, the **generate** command.
18
+
If you've been using a language built with the yeoman generator for Langium, you should be able to find your CLI defined in **src/cli/main.ts**. This file describes the general layout of your languages's command line interface, and lets you register specific commands. By default, you're provided with a single command for your CLI, the **generate** command.
19
19
20
20
Much like the command implies, it allows you to take a program written in your DSL, parse it, and traverse the AST to produce some sort of generated output. We won't talk about the generator itself in this tutorial (that will come in the [next tutorial on generation](/docs/learn/minilogo/generation)). Instead we'll focus on a simple example for parsing and validating a program, which allows learning more about the CLI itself.
21
21
@@ -25,7 +25,7 @@ To start, let's write up a custom action to allow us to **parse** and **validate
25
25
26
26
Feel free to keep (or remove) the existing **generate** action, as we won't be setting that up until the next tutorial. We'll be sure to present example code for that as well, so don't worry about deleting functions that you'll need later.
27
27
28
-
In order to add our new command, we need to register it in the default export for the **index.ts** file. In this function, there's a **command** object, which is a collection of commands for our CLI. Let's call our command `parseAndValidate`, and give it some extra details, like:
28
+
In order to add our new command, we need to register it in the default export for the **src/cli/main.ts** file. In this function, there's a **command** object, which is a collection of commands for our CLI. Let's call our command `parseAndValidate`, and give it some extra details, like:
29
29
30
30
-**arguments**: Indicating that it takes a single file
31
31
- a **description** detailing what this action does
Copy file name to clipboardExpand all lines: hugo/content/docs/learn/minilogo/generation.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -312,7 +312,7 @@ export function generateCommands(model: Model, filePath: string, destination: st
312
312
}
313
313
```
314
314
315
-
And to connect it to the CLI, which is setup in **src/cli/index.ts**, we can register it by slightly modifying the existing `generateAction` endpoint that was there by default.
315
+
And to connect it to the CLI, which is setup in **src/cli/main.ts**, we can register it by slightly modifying the existing `generateAction` endpoint that was there by default.
0 commit comments