Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Unified Diff: remoting/host/setup/start_host_main.cc

Issue 2930543002: [remoting start-host] Make --name optional, and other tweaks. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/setup/start_host_main.cc
diff --git a/remoting/host/setup/start_host_main.cc b/remoting/host/setup/start_host_main.cc
index 4c0d14b5322c60359dedcf5e22ea80d2d766152b..df74f6d149654b38d3b9e7f81214c47035de19c5 100644
--- a/remoting/host/setup/start_host_main.cc
+++ b/remoting/host/setup/start_host_main.cc
@@ -157,16 +157,21 @@ int StartHostMain(int argc, char** argv) {
}
#endif // defined(OS_WIN)
- if (host_name.empty()) {
+ if (command_line->HasSwitch("help") || command_line->HasSwitch("h") ||
+ command_line->HasSwitch("?") || !command_line->GetArgs().empty()) {
fprintf(stderr,
- "Usage: %s --name=<hostname> [--code=<auth-code>] [--pin=<PIN>] "
+ "Usage: %s [--name=<hostname>] [--code=<auth-code>] [--pin=<PIN>] "
"[--redirect-url=<redirectURL>]\n",
argv[0]);
- fprintf(stderr, "\nAuthorization URL for Production services:\n");
- fprintf(stderr, "%s\n", GetAuthorizationCodeUri().c_str());
return 1;
}
+ if (host_name.empty()) {
+ fprintf(stdout, "Enter a name for this computer: ");
+ fflush(stdout);
+ host_name = ReadString(false);
+ }
+
if (host_pin.empty()) {
while (true) {
fprintf(stdout, "Enter a PIN of at least six digits: ");
@@ -197,6 +202,8 @@ int StartHostMain(int argc, char** argv) {
}
if (auth_code.empty()) {
+ fprintf(stdout, "\nAuthorization URL for Production services:\n");
+ fprintf(stdout, "%s\n\n", GetAuthorizationCodeUri().c_str());
fprintf(stdout, "Enter an authorization code: ");
fflush(stdout);
auth_code = ReadString(true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698