mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
Don't show edit CLI command when not building editor
This commit is contained in:
parent
024c66685b
commit
9cb1026933
1 changed files with 15 additions and 10 deletions
|
@ -30,7 +30,7 @@ pub const DIRECTORY_OR_FILES: &str = "DIRECTORY_OR_FILES";
|
||||||
pub const ARGS_FOR_APP: &str = "ARGS_FOR_APP";
|
pub const ARGS_FOR_APP: &str = "ARGS_FOR_APP";
|
||||||
|
|
||||||
pub fn build_app<'a>() -> App<'a> {
|
pub fn build_app<'a>() -> App<'a> {
|
||||||
App::new("roc")
|
let app = App::new("roc")
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.subcommand(App::new(CMD_BUILD)
|
.subcommand(App::new(CMD_BUILD)
|
||||||
.about("Build a program")
|
.about("Build a program")
|
||||||
|
@ -81,15 +81,6 @@ pub fn build_app<'a>() -> App<'a> {
|
||||||
.subcommand(App::new(CMD_REPL)
|
.subcommand(App::new(CMD_REPL)
|
||||||
.about("Launch the interactive Read Eval Print Loop (REPL)")
|
.about("Launch the interactive Read Eval Print Loop (REPL)")
|
||||||
)
|
)
|
||||||
.subcommand(App::new(CMD_EDIT)
|
|
||||||
.about("Launch the Roc editor")
|
|
||||||
.arg(Arg::with_name(DIRECTORY_OR_FILES)
|
|
||||||
.index(1)
|
|
||||||
.multiple(true)
|
|
||||||
.required(false)
|
|
||||||
.help("(optional) The directory or files to open on launch.")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.subcommand(
|
.subcommand(
|
||||||
App::new(CMD_DOCS)
|
App::new(CMD_DOCS)
|
||||||
.about("Generate documentation for Roc modules")
|
.about("Generate documentation for Roc modules")
|
||||||
|
@ -100,7 +91,21 @@ pub fn build_app<'a>() -> App<'a> {
|
||||||
.help("The directory or files to build documentation for")
|
.help("The directory or files to build documentation for")
|
||||||
|
|
||||||
)
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if cfg!(feature = "edit") {
|
||||||
|
app.subcommand(
|
||||||
|
App::new(CMD_EDIT).about("Launch the Roc editor").arg(
|
||||||
|
Arg::with_name(DIRECTORY_OR_FILES)
|
||||||
|
.index(1)
|
||||||
|
.multiple(true)
|
||||||
|
.required(false)
|
||||||
|
.help("(optional) The directory or files to open on launch."),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
app
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn docs(files: Vec<PathBuf>) {
|
pub fn docs(files: Vec<PathBuf>) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue