text stringlengths 0 834k |
|---|
return; |
} |
} |
# Remove profile N: |
elsif (matches($args[0], ""del|ete"")) { |
my $num = $args[1] =~ /^\d+$/ ? $args[1] : |
do { |
my $n = find_index($args[1], 1, @profiles); |
if ($n < 1) { |
$o->inform(""No such profile '$args[1]'.\n""); |
return; |
} |
$n; |
} if defined $args[1]; |
if (defined $num and $num =~ /^\d+$/) { |
my $dead_profile = $profiles[$num-1]; |
if (bounded(1, $num, scalar @profiles)) { |
PPM::UI::profile_del($dead_profile); |
@profiles = dictsort PPM::UI::profile_list()->result_l; |
if (@profiles and $dead_profile eq $profile) { |
$profile = $profiles[0]; |
PPM::UI::profile_set($profile); |
} |
elsif (not @profiles) { |
$o->conf('profile-track', 0); |
PPM::UI::profile_set(''); |
} |
} |
else { |
$o->warn(""No such profile '$num'.\n""); |
return; |
} |
} |
elsif (defined $num) { |
$o->warn(<<END); |
Argument to '$args[0]' must be numeric; see 'help profile'. |
END |
return; |
} |
else { |
$o->warn(<<END); |
Invalid use of '$args[0]' command; see 'help profile'. |
END |
return; |
} |
} |
# Save current profile: |
elsif (matches($args[0], ""s|ave"")) { |
unless (@profiles) { |
$o->warn(<<END); |
No profiles on the server. Use 'profile add' to add a profile. |
END |
return; |
} |
unless ($which >= 0) { |
$o->warn(<<END); |
No profile selected. Use 'profile <number>' to select a profile. |
END |
return; |
} |
my $ok = PPM::UI::profile_save($profile); |
if ($ok->ok) { |
$o->inform(""Profile '$profile' saved.\n""); |
} |
else { |
$o->warn($ok->msg); |
return; |
} |
return 1; |
} |
# Rename profile: |
elsif (matches($args[0], ""ren|ame"")) { |
unless (@profiles) { |
$o->warn(<<END); |
No profiles on the server. Use 'profile add' to add a profile. |
END |
return; |
} |
# Determine the old name: |
my $num = $args[1] =~ /^\d+$/ ? $args[1] : |
do { |
my $n = find_index($args[1], 1, @profiles); |
if ($n < 1) { |
$o->warn(""No such profile '$args[1]'.\n""); |
return; |
}; |
$n; |
} if defined $args[1]; |
my $oldprof; |
if (defined $num and $num =~ /^\d+$/) { |
if (bounded(1, $num, scalar @profiles)) { |
$oldprof = $profiles[$num - 1]; |
} |
else { |
$o->warn(""No such profile number '$num'.\n""); |
return; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.