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:
parent
1f9c006739
commit
8f0ede34ad
@ -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)
|
||||
}
|
||||
|
@ -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.
|
||||
|
12
cmd/v/v.v
12
cmd/v/v.v
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user