Skip to content

Commit

Permalink
colored header help start
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Feb 6, 2020
1 parent 4bdc7b9 commit 74c9a3d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// Global Default Parameters
params{
version = '0.1.0'
// Colored output for log by default
monochrome_logs = false
}

manifest {
Expand Down
43 changes: 43 additions & 0 deletions pipeline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,46 @@
Katherine Eaton <ktmeaton@gmail.com> - https://github.com/ktmeaton>
========================================================================================
*/

def helpMessage() {
log.info nfcoreHeader()
log.info"""
=========================================
${workflow.manifest.name} v${workflow.manifest.version}
=========================================
Usage:
The typical command for running the pipeline is as follows:
""".stripIndent()
}

// Show help message
params.help = false
if (params.help){
helpMessage()
exit 0
}


def nfcoreHeader() {
// Log colors ANSI codes
// Comes from nf-core/rnaseq and nf-core/eager
c_reset = params.monochrome_logs ? '' : "\033[0m";
c_dim = params.monochrome_logs ? '' : "\033[2m";
c_black = params.monochrome_logs ? '' : "\033[0;30m";
c_green = params.monochrome_logs ? '' : "\033[0;32m";
c_yellow = params.monochrome_logs ? '' : "\033[0;33m";
c_blue = params.monochrome_logs ? '' : "\033[0;34m";
c_purple = params.monochrome_logs ? '' : "\033[0;35m";
c_cyan = params.monochrome_logs ? '' : "\033[0;36m";
c_white = params.monochrome_logs ? '' : "\033[0;37m";

return """ -${c_dim}--------------------------------------------------${c_reset}-
${c_green},--.${c_black}/${c_green},-.${c_reset}
${c_blue} ___ __ __ __ ___ ${c_green}/,-._.--~\'${c_reset}
${c_blue} |\\ | |__ __ / ` / \\ |__) |__ ${c_yellow}} {${c_reset}
${c_blue} | \\| | \\__, \\__/ | \\ |___ ${c_green}\\`-._,-`-,${c_reset}
${c_green}`._,._,\'${c_reset}
${c_purple} ${workflow.manifest.name} v${workflow.manifest.version}${c_reset}
-${c_dim}--------------------------------------------------${c_reset}-
""".stripIndent()
}

0 comments on commit 74c9a3d

Please sign in to comment.