1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v doc: add available output formats (#9180)

This commit is contained in:
Patrick Hintermayer 2021-03-08 16:21:40 +01:00 committed by GitHub
parent 1f9c006739
commit 8f0ede34ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 11 deletions

View File

@ -485,7 +485,8 @@ fn parse_arguments(args []string) Config {
}
fn main() {
if os.args.len < 2 || '-h' in os.args || '--help' in os.args || os.args[1..] == ['doc', 'help'] {
if os.args.len < 2 || '-h' in os.args || '-help' in os.args || '--help' in os.args
|| os.args[1..] == ['doc', 'help'] {
os.system('$vexe help doc')
exit(0)
}

View File

@ -13,7 +13,8 @@ or Markdown format.
Options:
-all Includes private and public functions/methods/structs/consts/enums.
-f Specifies the output format to be used.
-f Specifies the output format to be used. Available formats are:
md/markdown, json, text, stdout and html/htm
-h, -help Prints this help text.
-m Generate docs for modules listed in that folder.
-o Specifies the output file/folder path where to store the generated docs.

View File

@ -71,15 +71,6 @@ fn main() {
}
args_and_flags := util.join_env_vflags_and_os_args()[1..]
prefs, command := pref.parse_args(external_tools, args_and_flags)
if prefs.is_help {
invoke_help_and_exit(args)
}
if prefs.is_verbose {
// println('args= ')
// println(args) // QTODO
// println('prefs= ')
// println(prefs) // QTODO
}
if prefs.use_cache && os.user_os() == 'windows' {
eprintln('-usecache is currently disabled on windows')
exit(1)
@ -138,6 +129,9 @@ fn main() {
builder.compile(command, prefs)
return
}
if prefs.is_help {
invoke_help_and_exit(args)
}
eprintln('v $command: unknown command\nRun "v help" for usage.')
exit(1)
}