Skip to content

Commit

Permalink
upd help message
Browse files Browse the repository at this point in the history
  • Loading branch information
vmikk committed Oct 8, 2024
1 parent d5c3d8a commit c9a10da
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions seqhasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,24 +162,27 @@ func printUsage(w io.Writer) {
fmt.Fprintf(w, " %s\n", color.WhiteString("seqhasher [options] <input_file> [output_file]"))
fmt.Fprintln(w, color.HiCyanString("\nOverview:"))
fmt.Fprintln(w, color.WhiteString(" SeqHasher takes DNA sequences from a FASTA file, computes a hash digest for each sequence,"))
fmt.Fprintln(w, color.WhiteString(" and generates an output file with modified sequences."))
fmt.Fprintln(w, color.WhiteString(" and generates an output file with modified headers."))
fmt.Fprintln(w, color.WhiteString(" For input/output via stdin/stdout, use '-' instead of the file name."))
fmt.Fprintln(w, color.HiCyanString("\nOptions:"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-o"), color.HiMagentaString("--headersonly"), color.WhiteString(" Only output sequence headers, excluding the sequences themselves"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-H"), color.HiMagentaString("--hash <type1,type2,...>"), color.WhiteString(" Hash algorithm(s): sha1 (default), sha3, md5, xxhash, cityhash, murmur3, nthash, blake3"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-n"), color.HiMagentaString("--nofilename"), color.WhiteString(" Omit the file name from the sequence header"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-c"), color.HiMagentaString("--casesensitive"), color.WhiteString(" Take into account sequence case. By default, sequences are converted to uppercase"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-f"), color.HiMagentaString("--name <text>"), color.WhiteString(" Replace the input file's name in the header with <text>"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-v"), color.HiMagentaString("--version"), color.WhiteString(" Print the version of the program and exit"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-h"), color.HiMagentaString("--help"), color.WhiteString(" Show this help message and exit"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-o"), color.HiMagentaString("--headersonly"), color.WhiteString(" Output only sequence headers, excluding the sequences themselves"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-H"), color.HiMagentaString("--hash <type1,type2,...>"), color.WhiteString("Hash algorithm(s): sha1 (default), sha3, md5, xxhash, cityhash, murmur3, nthash, blake3"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-c"), color.HiMagentaString("--casesensitive"), color.WhiteString("Take into account sequence case. By default, sequences are converted to uppercase"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-n"), color.HiMagentaString("--nofilename"), color.WhiteString(" Omit the file name from the sequence header"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-f"), color.HiMagentaString("--name <text>"), color.WhiteString(" Replace the input file's name in the header with <text>"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-v"), color.HiMagentaString("--version"), color.WhiteString(" Print the version of the program and exit"))
fmt.Fprintf(w, " %s, %s %s\n", color.HiMagentaString("-h"), color.HiMagentaString("--help"), color.WhiteString(" Show this help message and exit"))
fmt.Fprintln(w, color.HiCyanString("\nArguments:"))
fmt.Fprintf(w, " %s %s\n", color.HiMagentaString("<input_file>"), color.WhiteString(" The path to the input FASTA file (could be compressed with gzip, zstd, xz, or bzip2) or '-' for standard input (stdin)"))
fmt.Fprintf(w, " %s %s\n", color.HiMagentaString("[output_file]"), color.WhiteString(" The path to the output file or '-' for standard output (stdout)"))
fmt.Fprintln(w, color.WhiteString(" If omitted, defaults to stdout."))
fmt.Fprintf(w, " %s %s\n", color.HiMagentaString("<input_file>"), color.WhiteString(" Path to the input FASTA file (supports gzip, zstd, xz, or bzip2 compression)"))
fmt.Fprintf(w, " %s\n", color.WhiteString(" or '-' for standard input (stdin)"))
fmt.Fprintf(w, " %s %s\n", color.HiMagentaString("[output_file]"), color.WhiteString(" Path to the output file or '-' for standard output (stdout)"))
fmt.Fprintln(w, color.WhiteString(" If omitted, output is sent to stdout."))
fmt.Fprintln(w, color.HiCyanString("\nExamples:"))
fmt.Fprintln(w, color.WhiteString(" seqhasher input.fasta.gz output.fasta"))
fmt.Fprintln(w, color.WhiteString(" cat input.fasta | seqhasher --name 'Sample' --hash xxhash - - > output.fasta"))
fmt.Fprintln(w, color.WhiteString(" seqhasher --headersonly --nofilename --hash sha1,nthash input.fa.gz - > headers.txt"))
fmt.Fprintln(w, color.WhiteString("\nFor more information, visit the GitHub repository:"))
fmt.Fprintln(w, color.WhiteString("https://github.com/vmikk/seqhasher"))
} else {
fmt.Fprintf(w, "SeqHasher v%s\n", version)
fmt.Fprintf(w, "Usage: %s [options] <input_file> [output_file]\n", os.Args[0])
Expand Down

0 comments on commit c9a10da

Please sign in to comment.