mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
flag: unify apis
This commit is contained in:
parent
66639924a4
commit
9ef8499183
8 changed files with 73 additions and 113 deletions
|
@ -137,16 +137,16 @@ pub fn (vgit_context mut VGitContext) compile_oldv_if_needed() {
|
|||
|
||||
pub fn add_common_tool_options<T>(context mut T, fp mut flag.FlagParser) []string {
|
||||
tdir := os.temp_dir()
|
||||
context.workdir = os.realpath(fp.string_('workdir', `w`, tdir, 'A writable base folder. Default: $tdir'))
|
||||
context.v_repo_url = fp.string('vrepo', vgit.remote_v_repo_url, 'The url of the V repository. You can clone it locally too. See also --vcrepo below.')
|
||||
context.vc_repo_url = fp.string('vcrepo', vgit.remote_vc_repo_url, 'The url of the vc repository. You can clone it
|
||||
context.workdir = os.realpath(fp.string('workdir', `w`, tdir, 'A writable base folder. Default: $tdir'))
|
||||
context.v_repo_url = fp.string('vrepo', 0, vgit.remote_v_repo_url, 'The url of the V repository. You can clone it locally too. See also --vcrepo below.')
|
||||
context.vc_repo_url = fp.string('vcrepo', 0, vgit.remote_vc_repo_url, 'The url of the vc repository. You can clone it
|
||||
${flag.SPACE}beforehand, and then just give the local folder
|
||||
${flag.SPACE}path here. That will eliminate the network ops
|
||||
${flag.SPACE}done by this tool, which is useful, if you want
|
||||
${flag.SPACE}to script it/run it in a restrictive vps/docker.
|
||||
')
|
||||
context.show_help = fp.bool_('help', `h`, false, 'Show this help screen.')
|
||||
context.verbose = fp.bool_('verbose', `v`, false, 'Be more verbose.')
|
||||
context.show_help = fp.bool('help', `h`, false, 'Show this help screen.')
|
||||
context.verbose = fp.bool('verbose', `v`, false, 'Be more verbose.')
|
||||
|
||||
if (context.show_help) {
|
||||
println(fp.usage())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue