View | Details | Raw Unified | Return to bug 235654
Collapse All | Expand All

(-)scripts/mytop.sh (-11 / +21 lines)
Lines 114-129 Link Here
114
my $RM_RESET   = 0;
114
my $RM_RESET   = 0;
115
my $RM_NOBLKRD = 3; ## using 4 traps Ctrl-C :-(
115
my $RM_NOBLKRD = 3; ## using 4 traps Ctrl-C :-(
116
116
117
# Add options from .my.cnf first
118
119
my $my_print_defaults;
120
if (!defined($my_print_defaults=my_which("my_print_defaults")))
121
{
122
  print "Warning: Can't find my_print_defaults. Please add it to your PATH!\n";
123
  exit(1);
124
}
125
126
unshift @ARGV, split "\n", `$my_print_defaults client mytop`;
127
117
128
## Read the user's config file, if it exists.
118
## Read the user's config file, if it exists.
129
119
Lines 142-154 Link Here
142
132
143
	    if (/(\S+)\s*=\s*(.*\S)/)
133
	    if (/(\S+)\s*=\s*(.*\S)/)
144
            {
134
            {
145
                $config{lc $1} = $2 if exists $config{lc $1};
135
                my $mytop_key = $1;
136
                my $mytop_val = $2;
137
                if ($mytop_key =~ /batch|batchmode|color|header|idle/)
138
                {
139
                    unshift @ARGV, "--$mytop_key" if ($mytop_val == 1);
140
                }
141
                else
142
                {
143
                    unshift @ARGV, "--$mytop_key=$mytop_val";
144
                }
146
            }
145
            }
147
        }
146
        }
148
        close CFG;
147
        close CFG;
149
    }
148
    }
150
}
149
}
151
150
151
# Add options from .my.cnf before options from ~/.mytop
152
153
my $my_print_defaults;
154
if (!defined($my_print_defaults=my_which("my_print_defaults")))
155
{
156
  print "Warning: Can't find my_print_defaults. Please add it to your PATH!\n";
157
  exit(1);
158
}
159
160
unshift @ARGV, split "\n", `$my_print_defaults client mytop`;
161
152
## Command-line args.
162
## Command-line args.
153
163
154
use vars qw($opt_foo);
164
use vars qw($opt_foo);

Return to bug 235654