Commit 19bb0c5
authored
feat(generate): default structure_definition and base_path when omitted (#114)
Summary
This PR improves the UX of the generate command by making both
positional arguments optional with sensible defaults. Users can now run
struct generate with no additional arguments when a .struct.yaml is
present in the current directory.
Motivation
- Streamline the most common workflow: running generation from the
current directory using a local .struct.yaml.
- Reduce friction and boilerplate for quick iterations and demos.
Changes
- CLI: Make positional args optional in GenerateCommand
- structure_definition defaults to .struct.yaml
- base_path defaults to .
- Explicitly provided arguments continue to override these defaults.
- Docs: Updated to reflect new defaults
- docs/cli-reference.md
- docs/usage.md
- docs/quickstart.md
Usage
```sh
# With defaults (if .struct.yaml exists in the current directory)
struct generate
# From a specific YAML file into a target directory (unchanged)
struct generate file://my-config.yaml ./output
# Using a built-in structure definition into a directory (unchanged)
struct generate python-basic ./my-project
```
Backward compatibility
- Existing commands remain valid; this is an additive improvement.
- Explicit arguments still take precedence over defaults.
Testing
- Full test suite executed locally: 112 tests passed.
- No behavior changes to existing flows other than allowing omitted
positional args with sensible defaults.
Docs
- CLI reference updated to show optional positional args and defaults.
- Usage and Quickstart updated with examples using struct generate
without arguments.
Closes #113.1 parent 3464fbf commit 19bb0c5
4 files changed
Lines changed: 37 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
63 | 72 | | |
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
67 | | - | |
68 | | - | |
| 76 | + | |
| 77 | + | |
69 | 78 | | |
70 | 79 | | |
71 | 80 | | |
| |||
139 | 148 | | |
140 | 149 | | |
141 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
142 | 159 | | |
143 | 160 | | |
144 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
36 | 44 | | |
37 | 45 | | |
38 | 46 | | |
| |||
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
52 | 66 | | |
53 | 67 | | |
54 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
0 commit comments