Changeset 2175 in ProjectBuilder for devel/pb-modules


Ignore:
Timestamp:
Feb 1, 2017, 2:08:51 AM (7 years ago)
Author:
Bruno Cornec
Message:

Adds man, help and versions options to pbdistrocheck and pbgetparam

Location:
devel/pb-modules/bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/bin/pbdistrocheck

    r2032 r2175  
    1414use lib qw (lib);
    1515#use lib '/usr/share/perl5'; # mandatory for opensuse
     16use ProjectBuilder::Version;
    1617use ProjectBuilder::Distribution;
    1718use ProjectBuilder::Base;
     
    108109my %opts;                   # CLI Options
    109110
     111my ($projectver,$projectrev) = pb_version_init();
     112my $appname = "pbgetparam";
     113
     114# Initialize the syntax string
     115
     116pb_syntax_init("$appname Version $projectver-$projectrev\n");
     117
    110118GetOptions(
    111119        "verbose|v+" => \$opts{'v'},
     120        "version" => \$opts{'version'},
     121        "man" => \$opts{'man'},
     122        "help|h" => \$opts{'h'},
    112123        "short|s" => \$opts{'s'},
    113         "help|h" => \$opts{'h'},
    114124        "description|d" => \$opts{'d'},
    115125        "id|i" => \$opts{'i'},
     
    119129        "lsb|l" => \$opts{'l'},
    120130);
     131if (defined $opts{'h'}) {
     132    pb_syntax(0,1);
     133}
     134if (defined $opts{'version'}) {
     135    pb_syntax(0,0);
     136}
     137if (defined $opts{'man'}) {
     138    pb_syntax(0,2);
     139}
    121140if (defined $opts{'v'}) {
    122141    $pbdebug = $opts{'v'};
  • devel/pb-modules/bin/pbgetparam

    r2153 r2175  
    1313use lib qw (lib);
    1414#use lib '/usr/share/perl5'; # mandatory for opensuse
     15use ProjectBuilder::Version;
    1516use ProjectBuilder::Base;
    1617use ProjectBuilder::Env;
     
    8990my %opts;                   # CLI Options
    9091
     92my ($projectver,$projectrev) = pb_version_init();
     93my $appname = "pbgetparam";
     94
     95# Initialize the syntax string
     96
     97pb_syntax_init("$appname Version $projectver-$projectrev\n");
     98
    9199GetOptions(
    92100        "verbose|v+" => \$opts{'v'},
     101        "version" => \$opts{'version'},
     102        "man" => \$opts{'man'},
    93103        "help|h" => \$opts{'h'},
    94104        "all|a" => \$opts{'a'},
     
    97107);
    98108if (defined $opts{'h'}) {
    99     pb_syntax(0,$opts{'h'}-1);
     109    pb_syntax(0,1);
     110}
     111if (defined $opts{'version'}) {
     112    pb_syntax(0,0);
    100113}
    101114if (defined $opts{'man'}) {
Note: See TracChangeset for help on using the changeset viewer.