Changeset 1694 in ProjectBuilder for devel/pb-modules/bin/pbdistrogetparam


Ignore:
Timestamp:
Feb 26, 2013, 6:37:21 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • pbdistrogetparam now works, is built & delivered, and has a new -a (all) option
  • New function pb_conf_get_all to return the list of all parameters, also now used by pb_conf_print
File:
1 edited

Legend:

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

    r1690 r1694  
    3232=head1 SYNOPSIS
    3333
    34 pbdistrogetparam [-h][-v][-p project][-d distro-ver-arch] param
     34pbdistrogetparam [-h][-v][-p project][-d distro-ver-arch] [param|-a]
    3535
    3636=head1 OPTIONS
     
    5353
    5454Name of the project you're working on (or use the env variable PBPROJ)
     55
     56=item B<-a|--all>
     57
     58Process all configuration parameters
    5559
    5660=back
     
    8892        "verbose|v+" => \$opts{'v'},
    8993        "help|h" => \$opts{'h'},
     94        "all|a" => \$opts{'a'},
    9095        "project|p=s" => \$opts{'p'},
    91         "distribution|d" => \$opts{'d'},
     96        "distribution|d=s" => \$opts{'d'},
    9297);
     98if (defined $opts{'h'}) {
     99    pb_syntax(0,$opts{'h'}-1);
     100}
     101if (defined $opts{'man'}) {
     102    pb_syntax(0,2);
     103}
    93104if (defined $opts{'v'}) {
    94105    $pbdebug = $opts{'v'};
     
    99110pb_env_init($opts{'p'},0,"none",0);
    100111my $pbos = pb_distro_get_context($dist);
    101 foreach my $r (pb_distro_get_param($pbos,pb_conf_get(@ARGV))) {
     112
     113my @tab = @ARGV;
     114@tab = pb_conf_get_all() if (defined $opts{'a'});
     115
     116my $i = 0;
     117foreach my $r (pb_distro_get_param($pbos,pb_conf_get(@tab))) {
     118    print "$tab[$i] => " if ((defined $opts{'v'}) || (defined $opts{'a'}));
     119    $i++;
    102120    print "$r\n";
    103121}
Note: See TracChangeset for help on using the changeset viewer.