diff --git a/vlib/v/help/help.v b/vlib/v/help/help.v index 519b707740fba4..3575c3f781003f 100644 --- a/vlib/v/help/help.v +++ b/vlib/v/help/help.v @@ -68,15 +68,15 @@ fn print_topic_unknown(topic string) { } fn print_known_topics() { - mut res := 'Known help topics: ' topic_paths := os.walk_ext(help_dir(), '.txt') - for i, path in topic_paths { + mut res := []string{} + for path in topic_paths { topic := os.file_name(path).all_before('.txt') if topic != 'default' { - res += topic + if i != topic_paths.len - 1 { ', ' } else { '.' } + res << topic } } - println(res) + println('Known help topics: ${res.sorted()}') } fn get_vexe() string { diff --git a/vlib/v/help/other/download.txt b/vlib/v/help/other/download.txt new file mode 100644 index 00000000000000..a2493f8f4eec1b --- /dev/null +++ b/vlib/v/help/other/download.txt @@ -0,0 +1,19 @@ +vdownload 0.0.1 +----------------------------------------------- +Usage: vdownload [options] URL1 URL2 ... + +Description: Download files from http/https servers, given their URLs. + +The arguments should be at least 1 in number. + +Options: + -h, --help Show this help screen. + -t, --target-folder + The target folder, where the file will be stored. It will be created, if it does not exist. Default is current folder. + -1, --sha1 Show the SHA1 hash of the downloaded file. + -2, --sha256 Show the SHA256 hash of the downloaded file. + -c, --continue Continue on download failures. If you download 5 URLs, and several of them fail, continue without error. False by default. + -r, --retries Number of retries, when an URL fails to download. + -d, --delay Delay in seconds, after each retry. + -R, --run Run, after the script/program is completely downloaded. + -D, --delete-after-run Delete the downloaded script/program, after it has been run.