@@ -32,9 +32,13 @@ protected function configure()
3232 ->addOption ('force ' , 'f ' , InputOption::VALUE_NONE , 'Log in again, even if already logged in ' );
3333 Url::configureInput ($ this ->getDefinition ());
3434
35- $ help = 'Use this command to log in to the ' . $ applicationName . ' using a browser. '
36- . "\n\n" . $ this ->getApiTokenHelp ();
37- $ this ->setHelp ($ help );
35+ $ executable = $ this ->config ()->get ('application.executable ' );
36+ $ help = 'Use this command to log in to the ' . $ applicationName . ' using a web browser. '
37+ . "\n\nIt launches a temporary local website which redirects you to log in if necessary, and then captures the resulting authorization code. "
38+ . "\n\nYour system's default browser will be used. You can override this using the <info>--browser</info> option. "
39+ . "\n\nAlternatively, to log in using an API token (without a browser), run: <info> $ executable auth:api-token-login</info> "
40+ . "\n\n" . $ this ->getNonInteractiveAuthHelp ();
41+ $ this ->setHelp (\wordwrap ($ help , 80 ));
3842 }
3943
4044 protected function execute (InputInterface $ input , OutputInterface $ output )
@@ -44,8 +48,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
4448 return 1 ;
4549 }
4650 if (!$ input ->isInteractive ()) {
47- $ this ->stdErr ->writeln ('Non-interactive login is not supported. ' );
48- $ this ->stdErr ->writeln ("\n" . $ this ->getApiTokenHelp ('comment ' ));
51+ $ this ->stdErr ->writeln ('Non-interactive use of this command is not supported. ' );
52+ $ this ->stdErr ->writeln ("\n" . $ this ->getNonInteractiveAuthHelp ('comment ' ));
4953 return 1 ;
5054 }
5155 if ($ this ->config ()->getSessionId () !== 'default ' || count ($ this ->api ()->listSessionIds ()) > 1 ) {
@@ -174,7 +178,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
174178 $ this ->stdErr ->writeln ('<options=bold>Help:</> ' );
175179 $ this ->stdErr ->writeln (' Leave this command running during login. ' );
176180 $ this ->stdErr ->writeln (' If you need to quit, use Ctrl+C. ' );
177- $ this ->stdErr ->writeln ("\n" . preg_replace ('/^/m ' , ' ' , $ this ->getApiTokenHelp ()));
178181 $ this ->stdErr ->writeln ('' );
179182
180183 // Wait for the file to be filled with an OAuth2 authorization code.
0 commit comments