spring_reference/VII. Spring Boot CLI/55. Using the CLI.md

42 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 55. 使用CLI
一旦安装好CLI你可以输入`spring`来运行它。如果你不使用任何参数运行`spring`,将会展现一个简单的帮助界面:
```shell
$ spring
usage: spring [--help] [--version]
<command> [<args>]
Available commands are:
run [options] <files> [--] [args]
Run a spring groovy script
... more command help is shown here
```
你可以使用`help`获取任何支持命令的详细信息。例如:
```shell
$ spring help run
spring run - Run a spring groovy script
usage: spring run [options] <files> [--] [args]
Option Description
------ -----------
--autoconfigure [Boolean] Add autoconfigure compiler
transformations (default: true)
--classpath, -cp Additional classpath entries
-e, --edit Open the file with the default system
editor
--no-guess-dependencies Do not attempt to guess dependencies
--no-guess-imports Do not attempt to guess imports
-q, --quiet Quiet logging
-v, --verbose Verbose logging of dependency
resolution
--watch Watch the specified file for changes
```
`version`命令提供一个检查你正在使用的Spring Boot版本的快速方式
```shell
$ spring version
Spring CLI v1.3.0.BUILD-SNAPSHOT
```