Skip to content

Commit 9a32078

Browse files
committed
Update to new CLI help output
1 parent fadbcc8 commit 9a32078

File tree

3 files changed

+25
-29
lines changed

3 files changed

+25
-29
lines changed
Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
11
Invalid option `--subpackage'
22

3-
Usage: index.dev.js (COMMAND | (-v|--version))
4-
PureScript package manager and build tool
3+
Usage: index.dev.js init [--migrate] [--monochrome|--no-color] [--offline] [-q|--quiet] [-v|--verbose] ([--subpackage ARG] | [--name ARG]) [--package-set ARG] [--use-solver]
4+
Initialise a new project
55

66
Available options:
7+
--migrate Migrate the spago.yaml file to the latest format
8+
--monochrome,--no-color Force logging without ANSI color escape sequences
9+
--offline Do not attempt to use the network. Warning: this will
10+
fail if you don't have the necessary dependencies
11+
already cached
12+
-q,--quiet Suppress all spago logging
13+
-v,--verbose Enable additional debug logging, e.g. printing `purs`
14+
commands
15+
--subpackage ARG Name of a subpackage to initialize within the current
16+
workspace
17+
--name ARG Optional package name to be used for the new project
18+
--package-set ARG Optional package set version to be used instead of
19+
the latest one
20+
--use-solver Use the solver instead of package sets
721
-h,--help Show this help text
8-
-v,--version Show the current version
9-
10-
Available commands:
11-
init Initialise a new project
12-
fetch Downloads all of the project's dependencies
13-
install Compile the project's dependencies
14-
uninstall Remove dependencies from a package
15-
build Compile the project
16-
run Run the project
17-
test Test the project
18-
bundle Bundle the project in a single file
19-
sources List all the source paths (globs) for the
20-
dependencies of the project
21-
repl Start a REPL
22-
publish Publish a package
23-
upgrade Upgrade to the latest package set, or to the latest
24-
versions of Registry packages
25-
docs Generate docs for the project and its dependencies
26-
registry Commands to interact with the Registry
27-
ls List packages or dependencies
28-
graph Generate a graph of modules or dependencies

test/Spago/Cli.purs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ spec = Spec.around withTempDir do
3232
{ stdoutFile: stdout
3333
, stderrFile: stderr
3434
, result
35-
, sanitize:
36-
String.trim
37-
>>> Regex.replace progNameRegex "Usage: index.dev.js"
38-
>>> Regex.replace optionsLineRegex " $1"
35+
, sanitize: sanitizeCliHelpOutput
3936
}
4037

38+
sanitizeCliHelpOutput :: String -> String
39+
sanitizeCliHelpOutput =
40+
String.trim
41+
>>> Regex.replace progNameRegex "Usage: index.dev.js"
42+
>>> Regex.replace optionsLineRegex " $1"
43+
where
4144
-- On Windows progname has the full path like
4245
-- "Usage: C:\whatever\index.dev.js", but on Unix
4346
-- it's just "Usage: index.dev.js"

test/Spago/InitSubpackage.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ module Test.Spago.InitSubpackage where
22

33
import Test.Prelude
44

5-
import Data.String as String
65
import Data.String.Regex as Regex
76
import Data.String.Regex.Flags as RF
87
import Node.Path as Path
98
import Spago.FS as FS
9+
import Test.Spago.Cli (sanitizeCliHelpOutput)
1010
import Test.Spec (SpecT)
1111
import Test.Spec as Spec
1212

@@ -54,7 +54,7 @@ spec =
5454
, stderrFile: Just fixture
5555
, result
5656
, sanitize:
57-
String.trim
57+
sanitizeCliHelpOutput
5858
>>> withForwardSlashes
5959
>>> Regex.replace versionsRegex "Found PureScript a.b.c, will use package set x.y.z"
6060
}

0 commit comments

Comments
 (0)