Skip to content

Commit

Permalink
Rename CLI flags to subcommands (#2212)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju authored and ry committed Apr 25, 2019
1 parent b426ecc commit aa85a4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 4 additions & 8 deletions cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,9 @@ pub fn create_cli_app<'a, 'b>() -> App<'a, 'b> {
.global_settings(&[AppSettings::ColorNever])
.settings(&[
AppSettings::AllowExternalSubcommands,
AppSettings::DisableHelpSubcommand,
AppSettings::DisableVersion,
]).after_help(ENV_VARIABLES_HELP)
.arg(
Arg::with_name("version")
.short("v")
.long("version")
.help("Print the version"),
).arg(
Arg::with_name("allow-read")
.long("allow-read")
.help("Allow file system read access"),
Expand Down Expand Up @@ -95,7 +90,8 @@ pub fn create_cli_app<'a, 'b>() -> App<'a, 'b> {
.use_delimiter(true)
.require_equals(true)
.help("Set V8 command line options"),
).subcommand(
).subcommand(SubCommand::with_name("version").about("Print the version"))
.subcommand(
SubCommand::with_name("fetch")
.setting(AppSettings::DisableVersion)
.about("Fetch the dependencies")
Expand Down Expand Up @@ -205,7 +201,7 @@ mod tests {

#[test]
fn test_set_flags_1() {
let flags = flags_from_vec(svec!["deno", "--version"]);
let flags = flags_from_vec(svec!["deno", "version"]);
assert_eq!(
flags,
DenoFlags {
Expand Down
3 changes: 2 additions & 1 deletion website/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ FLAGS:
--no-prompt Do not use prompts
-r, --reload Reload source code cache (recompile TypeScript)
--v8-options Print V8 command line options
-v, --version Print the version

OPTIONS:
--v8-flags=<v8-flags> Set V8 command line options
Expand All @@ -563,8 +562,10 @@ SUBCOMMANDS:
eval Eval script
fetch Fetch the dependencies
fmt Format files
help Prints this message or the help of the given subcommand(s)
info Show source file related info
types Print runtime TypeScript declarations
version Print the version

ENVIRONMENT VARIABLES:
DENO_DIR Set deno's base directory
Expand Down

0 comments on commit aa85a4d

Please sign in to comment.