tools: 'v create' -> 'v new'

pull/4287/head
Major Taylor 2020-04-07 13:37:15 -04:00 committed by GitHub
parent 6bbd1943dd
commit efeea40520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -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()

View File

@ -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.

View File

@ -68,7 +68,7 @@ fn main() {
'help' {
invoke_help_and_exit(args)
}
'create', 'init' {
'new', 'init' {
util.launch_tool(prefs.is_verbose, 'vcreate')
return
}