binman-help - add help options to your program
binman-help
FILE ... [-h
|--help
[PATTERN]] ... [--
] ...
If the given argument sequence contains -h
or --help
, except after --
,
then this program displays the given FILE's "embedded manpage source",
described in binman-text(1), and then terminates with exit status 0
.
Otherwise, this program terminates with the nonzero exit status 111
.
See "Embedded manpage sources" in binman-text(1) for header comment syntax.
#!/usr/bin/sh
# your program's manual page goes here
binman-help "$0" "$@" && exit
#!/usr/bin/env ruby
# your program's manual page goes here
require 'binman'
BinMan.help
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-help', __FILE__, @ARGV) == 0 and exit;
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 sys, subprocess
subprocess.call(['binman-help', __file__] + sys.argv) == 0 and sys.exit()
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); gsub("\0"," ",c);
if(system("binman-help" c) == 0){ exit }}
#!/usr/bin/env tclsh
# your program's manual page goes here
if {![catch {exec -- >/dev/tty binman-help $argv0 {*}$argv}]} {exit}
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
*/
var exec = require('child_process').exec;
exec(['>/dev/tty', 'binman-help', __filename].concat(process.argv).
join(' '), function(error){ if (error === null){ process.exit(); } });
-h
[PATTERN], --help
[PATTERN]binman-text(1), binman-roff(1), binman-html(1), binman-show(1), binman(1)