summaryrefslogtreecommitdiff
path: root/ifconfig.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2023-04-27 18:24:52 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2023-04-27 18:24:52 +0200
commit296512eaab30ec5bcba041d4f3db52b12e10fe2d (patch)
treeee374e5fc0d695d8b1503f906e25de095858b41a /ifconfig.c
parent54f8b58fc17b278596f4def1b690e719913c2e75 (diff)
downloadabase-296512eaab30ec5bcba041d4f3db52b12e10fe2d.tar.gz
abase-296512eaab30ec5bcba041d4f3db52b12e10fe2d.tar.bz2
fixed -a in ifconfig (do not show usage)
Diffstat (limited to 'ifconfig.c')
-rw-r--r--ifconfig.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/ifconfig.c b/ifconfig.c
index 809be95..609e849 100644
--- a/ifconfig.c
+++ b/ifconfig.c
@@ -217,23 +217,23 @@ main(int argc, char *argv[])
}
if_freenameindex(interfaces);
}
- }
-
- if (argc == 1) {
- print_interface(argv[0]);
- } else if (argc == 2) {
- int up;
- if (strcmp(argv[1], "up") == 0) {
- up = 1;
- } else if (strcmp(argv[1], "down") == 0) {
- up = 0;
+ } else {
+ if (argc == 1) {
+ print_interface(argv[0]);
+ } else if (argc == 2) {
+ int up;
+ if (strcmp(argv[1], "up") == 0) {
+ up = 1;
+ } else if (strcmp(argv[1], "down") == 0) {
+ up = 0;
+ } else {
+ weprintf("Expecting 'up' or 'down'\n");
+ usage();
+ }
+ set_up_down(argv[0], up);
} else {
- weprintf("Expecting 'up' or 'down'\n");
usage();
}
- set_up_down(argv[0], up);
- } else {
- usage();
}
return 0;