summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2019-04-15 17:57:37 +0200
committerSumit Bose <sbose@redhat.com>2019-04-15 18:09:23 +0200
commit4794812cc98c8783921f534d20dae8b44f3826d2 (patch)
treef78d5207926cd475633c8dad0722ea13ce03fdf8 /tools
parentcac0fa9df8888245399f2db187e05e31f93d1471 (diff)
tools: remove errx from info commands
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1588596
Diffstat (limited to 'tools')
-rw-r--r--tools/info.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/info.c b/tools/info.c
index e7e20ad..c63e0ff 100644
--- a/tools/info.c
+++ b/tools/info.c
@@ -162,21 +162,28 @@ adcli_tool_info (adcli_conn *unused,
if (argc == 1)
domain = argv[0];
- else if (argc != 0)
- errx (2, "specify one user name to create");
+ else if (argc != 0) {
+ warnx ("specify one user name to create");
+ return 2;
+ }
if (server) {
adcli_disco_host (server, &disco);
- if (disco == NULL)
- errx (1, "couldn't discover domain controller: %s", server);
+ if (disco == NULL) {
+ warnx ("couldn't discover domain controller: %s", server);
+ return 1;
+ }
for_host = 1;
} else if (domain) {
adcli_disco_domain (domain, &disco);
- if (disco == NULL)
- errx (1, "couldn't discover domain: %s", domain);
+ if (disco == NULL) {
+ warnx ("couldn't discover domain: %s", domain);
+ return 1;
+ }
for_host = 0;
} else {
- errx (2, "specify a domain to discover");
+ warnx ("specify a domain to discover");
+ return 2;
}
print_info (disco, for_host);