Skip to content

Commit b2507db

Browse files
committed
Organize and clarify --help text
1 parent e2bed8c commit b2507db

File tree

2 files changed

+40
-35
lines changed

2 files changed

+40
-35
lines changed

README.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,36 @@ Usage:
3030
postcss <input.css>... [OPTIONS] --replace
3131
3232
Basic options:
33-
-o, --output Output file [string]
34-
-d, --dir Output directory [string]
35-
-r, --replace Replace (overwrite) the input file [boolean]
36-
--map, -m Create an external sourcemap
37-
--no-map Disable the default inline sourcemaps
38-
--verbose Be verbose [boolean]
39-
--watch, -w Watch files for changes and recompile as needed [boolean]
40-
--env A shortcut for setting NODE_ENV [string]
41-
--include-dotfiles Enables glob to match files/dirs that begin with "." [boolean]
42-
43-
Options for when not using a config file:
33+
-o, --output Output file [string]
34+
-d, --dir Output directory [string]
35+
-r, --replace Replace (overwrite) the input file [boolean]
36+
-m, --map Create an external sourcemap
37+
--no-map Disable the default inline sourcemaps
38+
-w, --watch Watch files for changes and recompile as needed [boolean]
39+
--verbose Be verbose [boolean]
40+
--env A shortcut for setting NODE_ENV [string]
41+
42+
Options for use without a config file:
4443
-u, --use List of postcss plugins to use [array]
4544
--parser Custom postcss parser [string]
4645
--stringifier Custom postcss stringifier [string]
4746
--syntax Custom postcss syntax [string]
4847
48+
Options for use with --dir:
49+
--ext Override the output file extension; for use with --dir [string]
50+
--base Mirror the directory structure relative to this path in the output
51+
directory, for use with --dir [string]
52+
4953
Advanced options:
50-
--ext Override the output file extension; for use with --dir [string]
51-
--base Mirror the directory structure relative to this path in the output
52-
directory, for use with --dir [string]
53-
--poll Use polling for file watching. Can optionally pass polling interval;
54-
default 100 ms
55-
--config Set a custom directory to look for a config file [string]
54+
--include-dotfiles Enable glob to match files/dirs that begin with "."
55+
[boolean]
56+
--poll Use polling for file watching. Can optionally pass polling
57+
interval; default 100 ms
58+
--config Set a custom directory to look for a config file [string]
5659
5760
Options:
58-
--version Show version number [boolean]
59-
-h, --help Show help [boolean]
61+
--version Show version number [boolean]
62+
-h, --help Show help [boolean]
6063
6164
Examples:
6265
postcss input.css -o output.css Basic usage
@@ -68,8 +71,9 @@ If no input files are passed, it reads from stdin. If neither -o, --dir, or
6871
6972
If there are multiple input files, the --dir or --replace option must be passed.
7073
71-
Input files may contain globs (e.g. src/**/*.css). If you pass an input directory, it will process
72-
all files in the directory and any subdirectories, respecting the glob pattern.
74+
Input files may contain globs (e.g. src/**/*.css). If you pass an input
75+
directory, it will process all files in the directory and any subdirectories,
76+
respecting the glob pattern.
7377
```
7478

7579
> ℹ️ More details on custom parsers, stringifiers and syntaxes, can be found [here](https://github.com/postcss/postcss#syntaxes).

lib/args.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Usage:
3737
$0 <input.css>... [OPTIONS] --replace`
3838
)
3939
.group(
40-
['o', 'd', 'r', 'map', 'no-map', 'verbose', 'watch', 'env'],
40+
['o', 'd', 'r', 'map', 'no-map', 'watch', 'verbose', 'env'],
4141
'Basic options:'
4242
)
4343
.option('o', {
@@ -58,30 +58,26 @@ Usage:
5858
type: 'boolean',
5959
conflicts: ['output', 'dir'],
6060
})
61-
.option('include-dotfiles', {
62-
desc: 'Enables glob to match files/dirs that begin with "."',
63-
type: 'boolean',
64-
})
65-
.alias('map', 'm')
61+
.alias('m', 'map')
6662
.describe('map', 'Create an external sourcemap')
6763
.describe('no-map', 'Disable the default inline sourcemaps')
68-
.option('verbose', {
69-
desc: 'Be verbose',
70-
type: 'boolean',
71-
})
72-
.option('watch', {
73-
alias: 'w',
64+
.option('w', {
65+
alias: 'watch',
7466
desc: 'Watch files for changes and recompile as needed',
7567
type: 'boolean',
7668
conflicts: 'replace',
7769
})
70+
.option('verbose', {
71+
desc: 'Be verbose',
72+
type: 'boolean',
73+
})
7874
.option('env', {
7975
desc: 'A shortcut for setting NODE_ENV',
8076
type: 'string',
8177
})
8278
.group(
8379
['u', 'parser', 'stringifier', 'syntax'],
84-
'Options for when not using a config file:'
80+
'Options for use without a config file:'
8581
)
8682
.option('u', {
8783
alias: 'use',
@@ -100,7 +96,7 @@ Usage:
10096
desc: 'Custom postcss syntax',
10197
type: 'string',
10298
})
103-
.group(['ext', 'base', 'poll', 'config'], 'Advanced options:')
99+
.group(['ext', 'base'], 'Options for use with --dir:')
104100
.option('ext', {
105101
desc: 'Override the output file extension; for use with --dir',
106102
type: 'string',
@@ -116,6 +112,11 @@ Usage:
116112
type: 'string',
117113
implies: 'dir',
118114
})
115+
.group(['include-dotfiles', 'poll', 'config'], 'Advanced options:')
116+
.option('include-dotfiles', {
117+
desc: 'Enable glob to match files/dirs that begin with "."',
118+
type: 'boolean',
119+
})
119120
.option('poll', {
120121
desc:
121122
'Use polling for file watching. Can optionally pass polling interval; default 100 ms',

0 commit comments

Comments
 (0)