File: demo-options

package info (click to toggle)
libgetopt-long-descriptive-perl 0.116-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 236 kB
  • sloc: perl: 1,188; makefile: 2
file content (23 lines) | stat: -rwxr-xr-x 679 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env perl
use v5.20.0;
use warnings;

use lib 'lib';
use Getopt::Long::Descriptive;

# This program here is to spit out usage so you can see what things look like.
# It will change over time to keep demonstrating stuff.  Enjoy.

my ($opt, $usage) = describe_options(
  '%c %o',
  [ "simple",     "the simplest option" ],
  [ "alias|aka",  "something with two names" ],
  [ "short|s",    "something with a short name" ],
  [ "longdesc",   "The description for this option is relatively long, okay?" ],
  [], # a blank!
  [ "A sentence of text that runs just about the whole width of my terminal." ],
  [],
  [ "bananas|b!", "an on/off option" ],
);

print $usage->text;