|
From: Jeff S. <jsq...@us...> - 2002-05-19 00:22:33
|
Update of /cvsroot/env-switcher/env-switcher/src
In directory usw-pr-cvs1:/tmp/cvs-serv21489/src
Modified Files:
switcher.in
Log Message:
- Removed diag() subroutine -- we don't need it
- Added "switcher <tag> = <name>" syntax
- Updated man page to match
Index: switcher.in
===================================================================
RCS file: /cvsroot/env-switcher/env-switcher/src/switcher.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** switcher.in 18 May 2002 23:44:05 -0000 1.4
--- switcher.in 19 May 2002 00:22:30 -0000 1.5
***************
*** 901,906 ****
my %attributes;
my %sys_tags;
! my $d, $a;
# Iterate through all the tags in the system file. Resolve each
--- 901,907 ----
my %attributes;
+ my %user_vars;
my %sys_tags;
! my $d;
# Iterate through all the tags in the system file. Resolve each
***************
*** 947,951 ****
# the system default so that we can print out warnings.
! my %user_vars = $user_file->varlist(".*");
foreach (keys(%user_vars)) {
($tag) = split(/_/, $_);
--- 948,952 ----
# the system default so that we can print out warnings.
! %user_vars = $user_file->varlist(".*");
foreach (keys(%user_vars)) {
($tag) = split(/_/, $_);
***************
*** 993,1016 ****
############################################################################
#
- # diag
- #
- # Do some comparisons between the user's $HOME/.switcher.ini and the
- # system switcher.ini and report on the following conditions:
- #
- # - If the user's $HOME/.switcher.ini has a tag that does not exist
- # - If the user's $HOME/.switcher.ini has a value for the "default"
- # attribute that is a name that does not exist
- # - If the system switcher.ini has a tag that does not exist
- # - If the system switcher.ini has a value for the "default" attribute
- # that is a name that does not exist
- #
- ############################################################################
-
- sub diag {
- 0;
- }
-
- ############################################################################
- #
# write_ini_file
#
--- 994,997 ----
***************
*** 1158,1164 ****
show_exec();
$action_done = 1;
- } elsif ($ARGV[0] eq "--diag") {
- diag();
- $action_done = 1;
} elsif ($ARGV[0] eq "--announce") {
announce();
--- 1139,1142 ----
***************
*** 1214,1217 ****
--- 1192,1196 ----
$clui_args->define("rm-tag!");
$clui_args->define("add-name=s@");
+ $clui_args->define("\==s");
$clui_args->define("rm-name=s");
$clui_args->define("add-attr=s@");
***************
*** 1317,1320 ****
--- 1296,1308 ----
}
+ # "=" shortcut syntax
+
+ elsif ($ARGV[$i] eq "=") {
+ $return_value = add_attr($clui_args->system(),
+ "default", $ARGV[$i + 1],
+ $clui_args->force());
+ $action_done = 1;
+ }
+
# rm-attr
|