Skip to content

Commit 127f4d0

Browse files
committed
feat: add short option flags for common options
Added short flags for better CLI experience: - -s, --syntax (already existed) - -f, --filter (already existed) - -c, --config (new) - -i, --indent (new) - -t, --tab-stops (new) - -n, --no-tab-stops (new) Examples: emmet expand 'div.container>p' -s html -n emmet expand 'ul>li*2' -s html -i ' ' -n emmet expand 'div#app>header' -s html -f c -n Updated README with short option documentation and examples.
1 parent effc51c commit 127f4d0

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ Expand Emmet abbreviation to code.
6565
**Options:**
6666
- `-s, --syntax <lang>` - Language/syntax (html, css, jsx, etc.)
6767
- `-f, --filter <filters>` - Filters: bem, c, t (comma-separated)
68-
- `--config <path>` - Custom config directory
69-
- `--indent <chars>` - Indentation string (default: tab)
70-
- `--tab-stops` - Include tab stops (default: true)
71-
- `--no-tab-stops` - Disable tab stops
68+
- `-c, --config <path>` - Custom config directory
69+
- `-i, --indent <chars>` - Indentation string (default: tab)
70+
- `-t, --tab-stops` - Include tab stops (default: true)
71+
- `-n, --no-tab-stops` - Disable tab stops
7272
- `--var-<name>=<value>` - Set template variables
7373

7474
**Examples:**
@@ -95,9 +95,14 @@ emmet expand "button[onClick={handleClick}]" --syntax jsx
9595

9696
# Custom indentation (2 spaces)
9797
emmet expand "ul>li*2" --syntax html --indent " " --no-tab-stops
98+
# Or using short options:
99+
emmet expand "ul>li*2" -s html -i " " -n
98100

99101
# Set template variables
100102
emmet expand "!" --syntax html --var-lang=en --var-charset=UTF-8
103+
104+
# Using short options for quick commands
105+
emmet expand "div#app>header.header" -s html -f c -n
101106
```
102107

103108
### `emmet wrap <abbreviation>`

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ program
2020
program
2121
.option('-s, --syntax <lang>', 'Language/syntax (html, css, jsx, etc.)')
2222
.option('-f, --filter <filters>', 'Filters: bem, c, t (comma-separated)')
23-
.option('--config <path>', 'Custom config directory')
24-
.option('--indent <chars>', 'Indentation string (default: tab)', '\t')
25-
.option('--tab-stops', 'Include tab stops (default: true)', true)
26-
.option('--no-tab-stops', 'Disable tab stops')
23+
.option('-c, --config <path>', 'Custom config directory')
24+
.option('-i, --indent <chars>', 'Indentation string (default: tab)', '\t')
25+
.option('-t, --tab-stops', 'Include tab stops (default: true)', true)
26+
.option('-n, --no-tab-stops', 'Disable tab stops')
2727
.allowUnknownOption(); // Allow --var-* options
2828

2929
// Expand command

0 commit comments

Comments
 (0)