Skip to content

Commit

Permalink
Fix args bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
kitschpatrol committed Jan 15, 2024
1 parent 4b23bdc commit 3609048
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ npm --install --global @kitschpatrol/tldraw-cli
### Invocation

```sh
tldraw-cli fileOrUrl {options}
tldraw-cli file-or-url {options}
```

| Argument | Description |
| ----------- | ------------------------------------------------------------------------------------------------------ |
| `fileOrUrl` | The sketch to convert to an image — either a path to a local ".tldr" file, or a tldraw\.com sketch URL |
| Argument | Description |
| ------------- | ------------------------------------------------------------------------------------------------------ |
| `file-or-url` | The sketch to convert to an image — either a path to a local ".tldr" file, or a tldraw\.com sketch URL |

| Option | Description | Default |
| ----------------- | ------------------------------------------- | ------- |
Expand Down
7 changes: 4 additions & 3 deletions src/cli/tldraw-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { hideBin } from 'yargs/helpers'

await yargs(hideBin(process.argv))
.command(
'$0 <file>',
'Convert a tldraw ".tldr" file to an svg or png image',
'$0 <file-or-url>',
'Convert a tldraw ".tldr" file or tldraw.com URL to an svg or png image',
(yargs) =>
yargs
.positional('fileOrUrl', {
.positional('file-or-url', {
demandOption: true,
describe:
'The sketch to convert to an image — either a path to a local ".tldr" file, or a tldraw.com sketch URL',
Expand Down Expand Up @@ -40,6 +40,7 @@ await yargs(hideBin(process.argv))

try {
await tldrawToImage(fileOrUrl, format as ExportFormat, output, verbose)
process.exit(0)
} catch (error) {
console.error('Error during conversion:', error)
process.exit(1)
Expand Down

0 comments on commit 3609048

Please sign in to comment.