diff options
-rw-r--r-- | doc/adcli.xml | 4 | ||||
-rw-r--r-- | tools/computer.c | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/doc/adcli.xml b/doc/adcli.xml index 2257eef..108ffed 100644 --- a/doc/adcli.xml +++ b/doc/adcli.xml @@ -558,6 +558,10 @@ Password for Administrator: treated as fully qualified host name, otherwise it is treated as short computer name.</para> + <para>If no computer name is specified, then the host name of the + computer adcli is running on is used, as returned by + <literal>gethostname()</literal>.</para> + <para>The various global options can be used.</para> </refsect1> diff --git a/tools/computer.c b/tools/computer.c index c38123f..c12bd99 100644 --- a/tools/computer.c +++ b/tools/computer.c @@ -576,7 +576,7 @@ adcli_tool_computer_delete (adcli_conn *conn, }; static adcli_tool_desc usages[] = { - { 0, "usage: adcli delete-computer --domain=xxxx host1.example.com" }, + { 0, "usage: adcli delete-computer --domain=xxxx [host1.example.com]" }, { 0 }, }; @@ -601,7 +601,7 @@ adcli_tool_computer_delete (adcli_conn *conn, argc -= optind; argv += optind; - if (argc != 1) + if (argc > 1) errx (EUSAGE, "specify one host name of computer account to delete"); adcli_conn_set_allowed_login_types (conn, ADCLI_LOGIN_USER_ACCOUNT); @@ -613,7 +613,8 @@ adcli_tool_computer_delete (adcli_conn *conn, adcli_get_last_error ()); } - parse_fqdn_or_name (enroll, argv[0]); + if (argc == 1) + parse_fqdn_or_name (enroll, argv[0]); res = adcli_enroll_delete (enroll, 0); if (res != ADCLI_SUCCESS) { |