diff --git a/cmd/tools/vcreate.v b/cmd/tools/vcreate.v index c8fd155b48..2d3371e306 100644 --- a/cmd/tools/vcreate.v +++ b/cmd/tools/vcreate.v @@ -3,7 +3,7 @@ // that can be found in the LICENSE file. // This module follows a similar convention to Rust: `init` makes the -// structure of the program in the _current_ directory, while `create` +// structure of the program in the _current_ directory, while `new` // makes the program structure in a _sub_ directory. Besides that, the // functionality is essentially the same. module main @@ -86,6 +86,7 @@ fn (c &Create)create_git_repo(dir string) { if !os.is_dir('${dir}/.git') { os.exec('git init ${dir}') or { cerror('Unable to create git repo') + exit(4) } if !os.exists('${dir}/.gitignore') { mut fl := os.create('${dir}/.gitignore') or { @@ -151,7 +152,7 @@ fn init() { } fn main() { - if 'create' == os.args[1] { + if 'new' == os.args[1] { create() } else if 'init' == os.args[1] { init() diff --git a/cmd/v/internal/help/default.txt b/cmd/v/internal/help/default.txt index 428739027b..457d6bf40e 100644 --- a/cmd/v/internal/help/default.txt +++ b/cmd/v/internal/help/default.txt @@ -10,7 +10,8 @@ Examples: The commands are: build Build V code in the provided path (default). - create Setup the file structure for a V project. + new Setup the file structure for a V project (in a sub folder). + init Setup the file structure for an already existing V project. doc Generate the documentation for a V module. fmt Format the V code provided. repl Run the REPL. diff --git a/cmd/v/v.v b/cmd/v/v.v index bd67dc1dd9..8d1a21097f 100644 --- a/cmd/v/v.v +++ b/cmd/v/v.v @@ -68,7 +68,7 @@ fn main() { 'help' { invoke_help_and_exit(args) } - 'create', 'init' { + 'new', 'init' { util.launch_tool(prefs.is_verbose, 'vcreate') return }