diff --git a/cmd/tools/vdoc/vdoc.v b/cmd/tools/vdoc/vdoc.v index fce9a448c9..c1144f52a4 100644 --- a/cmd/tools/vdoc/vdoc.v +++ b/cmd/tools/vdoc/vdoc.v @@ -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) } diff --git a/cmd/v/help/doc.txt b/cmd/v/help/doc.txt index 6be2237262..a228f9f241 100644 --- a/cmd/v/help/doc.txt +++ b/cmd/v/help/doc.txt @@ -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. diff --git a/cmd/v/v.v b/cmd/v/v.v index 5387a8aaea..8cac0e7774 100644 --- a/cmd/v/v.v +++ b/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) }