binman-show - show manpage from header comment
binman-show
[OPTION]... [FILE] [PATTERN]
Extracts the "embedded manpage source", described in binman-text(1), from the given FILE or STDIN, transforms it into roff(7), and displays it in man(1).
If the optional PATTERN regular expression is specified, searches for it inside the output displayed by man(1) and jumps to the first match if found.
If man(1) cannot display the roff(7) conversion, falls back to the displaying the HTML conversion. And if that fails too, displays the manpage source as-is.
See "Embedded manpage sources" in binman-text(1) for header comment syntax.
#!/usr/bin/sh
# your program's manual page goes here
binman-show "$0"
#!/usr/bin/env ruby
# your program's manual page goes here
require 'binman'
BinMan.show
You can also specify your program's source file encoding above the manual:
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# your program's manual page goes here
You can also write the manual as a multi-line Ruby comment:
#!/usr/bin/env ruby
=begin
your program's manual page goes here
=end
You can also specify your program's source file encoding above the manual:
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
=begin
your program's manual page goes here
=end
#!/usr/bin/env perl
# your program's manual page goes here
system('binman-show', __FILE__);
You can also write the manual as a multi-line Ruby comment after __END__
:
#!/usr/bin/env perl
print "your program's code goes here";
__END__
=begin
your program's manual page goes here
=end
#!/usr/bin/env python
# your program's manual page goes here
import subprocess
subprocess.call(['binman-show', __file__])
You can also specify your program's source file encoding above the manual:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# your program's manual page goes here
You can also write the manual as a multi-line Ruby comment inside a docstring:
#!/usr/bin/env python
"""
=begin
your program's manual page goes here
=end
"""
You can also specify your program's source file encoding above the manual:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=begin
your program's manual page goes here
=end
"""
The technique for determining current AWK script file name comes from here.
#!/usr/bin/awk -f
# your program's manual page goes here
BEGIN {getline c <"/proc/self/cmdline"; sub(".*-f\0"," ",c); sub("\0.*","",c);
system("binman-show" c)}
#!/usr/bin/env tclsh
# your program's manual page goes here
exec >/dev/tty binman-show $argv0
You can also write the manual as a multi-line Ruby comment inside an if 0
:
#!/usr/bin/env tclsh
if 0 {
=begin
your program's manual page goes here
=end
}
/*
=begin
your program's manual page goes here
=end
*/
require('child_process').exec(['>/dev/tty', 'binman-show', __filename].join(' '));
-h
[PATTERN], --help
[PATTERN]binman-text(1), binman-roff(1), binman-html(1), binman-help(1), binman(1)