HELPメッセージの表示
@param terminal Terminal
327450
private void showHelp(final Terminal terminal) {
		showMessage(terminal, "/message.txt");
		commands.stream().filter(c -> !c.isHidden()).forEach(c -> c.showHelp(terminal));
	}
629877
public void setTerminal(AbstractUDPTerminal terminal) {
        this.terminal = terminal;
        if (terminal.isActive()) {
            transport = terminal.getTransport();
        }
    }
212888
function init() {
  // Retrieve any arguments passed in via the command line
  args = cliConfig.getArguments();

  // Supply usage info if help argument was passed
  if (args.help) {
    console.log(cliConfig.getUsage());
    process.exit(0);
  }

  getClientAuth(function(data) {
    parseClientAuth(data, function(err, data) {
      if (err) {
        console.error(err.message);
        process.exit(0);
      }
      writeEdgerc(data, function(err) {
        if (err) {
          if (err.errno == -13) {
            console.error("Unable to access " + err.path + ". Please make sure you " +
              "have permission to access this file or perhaps try running the " +
              "command as sudo.");
            process.exit(0);
          }
        }
        console.log("The section '" + args.section + "' has been succesfully added to " + args.path + "\n");
      });
    });
  });
}
337140
private void initialize(final Terminal terminal) throws Exception {
		terminal.writer().println("initialize.");

		ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();

		if (currentClassLoader.equals(additionalClassLoader)) {
			// すでに追加クラスローダになっている場合はいったん親に移動しておく
			currentClassLoader = additionalClassLoader.getParent();
		}

		String paths = p("sql.additionalClassPath", ".");
		List<URL> urls = new ArrayList<>();
		Arrays.stream(paths.split(";")).forEach(path -> {
			try {
				Matcher m = SYSPROP_PAT.matcher(path);
				StringBuffer sb = new StringBuffer();
				while (m.find()) {
					String key = m.group(1);
					String val = System.getProperty(key, null);
					if (val == null) {
						val = System.getenv(key);
					}
					if (val == null) {
						throw new IllegalArgumentException("key=" + key + " is not found.");
					}
					m.appendReplacement(sb, val.replace("\\", "/"));
				}
				m.appendTail(sb);

				urls.add(Paths.get(sb.toString()).toUri().toURL());
			} catch (Exception e) {
				e.printStackTrace();
			}
		});
		additionalClassLoader = new URLClassLoader(urls.toArray(new URL[urls.size()]), currentClassLoader);

		Thread.currentThread().setContextClassLoader(additionalClassLoader);

		ServiceLoader<Driver> loader = ServiceLoader.load(Driver.class, additionalClassLoader);
		loader.forEach(driver -> {
			try {
				DriverManager.registerDriver(new DriverShim(driver));
			} catch (Exception e) {
				e.printStackTrace();
			}
		});

		String url = p("db.url", "");
		String user = p("db.user", "");
		String password = p("db.password", "");
		String schema = p("db.schema", null);
		String loadPath = p("sql.loadPath", "sql");
		String fileExtension = p("sql.fileExtension", ".sql");
		Charset charset = Charset.forName(p("sql.encoding", "UTF-8"));
		boolean detectChanges = BooleanUtils.toBoolean(p("sql.detectChanges", "true"));

		// config
		sqlConfig = UroboroSQL.builder(url, user, password, schema)
				.setSqlManager(new NioSqlManagerImpl(loadPath, fileExtension, charset, detectChanges))
				.setSqlFilterManager(new SqlFilterManagerImpl().addSqlFilter(new DumpResultSqlFilter())).build();

		// sqlContextFactory
		SqlContextFactory contextFactory = sqlConfig.getSqlContextFactory();
		List<String> constantClassNames = Arrays
				.asList(p("sqlContextFactory.constantClassNames", "").split("\\s*,\\s*")).stream()
				.filter(s -> StringUtils.isNotEmpty(s)).collect(Collectors.toList());
		if (!constantClassNames.isEmpty()) {
			contextFactory.setConstantClassNames(constantClassNames);
		}

		List<String> enumConstantPackageNames = Arrays
				.asList(p("sqlContextFactory.enumConstantPackageNames", "").split("\\s*,\\s*")).stream()
				.filter(s -> StringUtils.isNotEmpty(s)).collect(Collectors.toList());
		if (!enumConstantPackageNames.isEmpty()) {
			contextFactory.setEnumConstantPackageNames(enumConstantPackageNames);
		}

		if (!constantClassNames.isEmpty() || !enumConstantPackageNames.isEmpty()) {
			contextFactory.initialize();
		}
	}
275552
function() {
      
      // Output Terminal
      if(!this.outputTerminal) {
   	   this.outputTerminal = this.addTerminal({xtype: "WireIt.util.TerminalOutput", "name": "out"});      
         this.outputTerminal.jsBox = this;
      }
      
      // Input terminals :
      var match = (this.textarea.value).match((/^[ ]*function[ ]*\((.*)\)[ ]*\{/));
   	var sParamList = match ? match[1] : "";
      var params = sParamList.split(',');
      var nParams = (sParamList=="") ? 0 : params.length;
      
      var curTerminalN = this.nParams || 0;
      if(curTerminalN < nParams) {
         // add terminals
         for(var i = curTerminalN ; i < nParams ; i++) {
            var term = this.addTerminal({xtype: "WireIt.util.TerminalInput", "name": "param"+i});
            //term.jsBox = this;
            WireIt.sn(term.el, null, {position: "absolute", top: "-15px"});
         }
      }
      else if (curTerminalN > nParams) {
         // remove terminals
         for(var i = this.terminals.length-(curTerminalN-nParams) ; i < this.terminals.length ; i++) {
         	this.terminals[i].remove();
         	this.terminals[i] = null;
         }
         this.terminals = WireIt.compact(this.terminals);
      }
      this.nParams = nParams;
   
      this.positionTerminals();

      // Declare the new terminals to the drag'n drop handler (so the wires are moved around with the container)
      this.dd.setTerminals(this.terminals);
   }
19760
public static void main(String[] args) throws IOException, FontFormatException, URISyntaxException {
		CliArgumentParser	parser = new CliArgumentParser(args);	
		LwjgFontFactory		lwjgFont = new LwjgFontFactory(parser.get(_p));
		
		if (parser.hasArgument(_x)) {
			//	キャラクターファイルを展開する
			lwjgFont.extractCharacterFiles();
		} else if (parser.hasArgument(_v)) {
			//	バージョンを表示する
			lwjgFont.printVersion();
		} else if (parser.hasArgument(_l)) {
			//	システムが認識しているフォント名を一覧表示する
			SystemFont.listLogicalFont();
		} else if (parser.hasFontSettings()) {
			//	フォントマップを作成する
			for (FontSetting fontSetting: parser.listFontSettings()) {
				lwjgFont.create(fontSetting);
			}
			lwjgFont.makePackage();
			lwjgFont.writeProcessLog();
		}
	}
483427
def print_help(self, prog_name, subcommand):
        
        parser = self.get_parser(prog_name, subcommand)
        parser.print_help()
173667
def p_bound_terminal(self, p):
        """"""
        if p[1][0].literal in ['*', '**']:
            p[0] = [_Segment(_BINDING, '$%d' % self.binding_var_count),
                    p[1][0],
                    _Segment(_END_BINDING, '')]
            self.binding_var_count += 1
        else:
            p[0] = p[1]
1037900
function help() {
    var padBtm = [0, 0, 1, 0];
    var msg = ' See additional required/optional arguments for each command below. \n';
    pargv
        .logo('Mustr', 'cyan')
        .ui(95)
        .join(chalk.magenta('Usage:'), 'mu', chalk.cyan('<cmd>'), '\n')
        .div({ text: chalk.bgBlue.white(msg) })
        .div({ text: chalk.cyan('help, h'), width: 35, padding: padBtm }, { text: chalk.gray('displays help and usage information.'), width: 40, padding: padBtm })
        .div({ text: chalk.cyan('init, i'), width: 35, padding: padBtm }, { text: chalk.gray('initialize the application for use with Mustr.'), width: 40, padding: padBtm })
        .div({ text: chalk.cyan('generate, g') + " " + chalk.white('<template>') + " " + chalk.magenta('[output]'), width: 35, padding: padBtm }, { text: chalk.gray('generates and renders a template.'), width: 40, padding: padBtm })
        .div({ text: chalk.white('<template>'), width: 35, padding: [0, 2, 0, 2] }, { text: chalk.gray('template to generate and compile.'), width: 40 }, { text: chalk.red('[required]'), align: 'right' })
        .div({ text: chalk.white('[output]'), width: 35, padding: [0, 2, 0, 2] }, { text: chalk.gray('output name/path for template'), width: 40, padding: padBtm })
        .div({ text: chalk.cyan('rollback, r') + " " + chalk.white('<name/id>') + " " + chalk.magenta('[output]'), width: 35, padding: padBtm }, { text: chalk.gray('Rolls back a template or component.'), width: 40, padding: padBtm })
        .div({ text: chalk.white('<name/id>'), width: 35, padding: [0, 2, 0, 2] }, { text: chalk.gray('the rollback id, index or template name.'), width: 40 })
        .div({ text: chalk.white('[output]'), width: 35, padding: [0, 2, 0, 2] }, { text: chalk.gray('output name/path for template'), width: 40, padding: padBtm })
        .div({ text: chalk.cyan('show, s') + " " + chalk.white('<type>'), width: 35, padding: padBtm }, { text: chalk.gray('shows details/stats for the given type.'), width: 40, padding: padBtm })
        .div({ text: chalk.white('<type>'), width: 35, padding: [0, 2, 0, 2] }, { text: chalk.gray('currently there is only one type "rollbacks"'), width: 40 })
        .show();
}
914380
function(message, options, callback) {
    // If no callback given create one
    if( ! callback) callback = function() {}

    // If a previous terminal has been opened then close it
    if(terminal) terminal.close()

    terminal = t_menu(this.options.menu)

    // Reset the terminal, clearing all contents
    if(this.options.reset) terminal.reset()

    if(this.options.title) terminal.write(this.options.formatTitle() + '\n\n')

    // Write message or messages to the console
    if(_.isString(message)) message = [message]
    _.each(message, function(message) {
      terminal.write(chalk.bold(message + '\n'))
    })

    terminal.write('\n')

    // If options were given write them to the console
    if(options) {
      _.each(options, function(option) {
        terminal.add(option)
      })

      terminal.write('\n')
      terminal.add('Cancel')
    }

    // Pipe the terminal menu to the console
    process.stdin.pipe(terminal.createStream()).pipe(process.stdout)

    // Run callback when a terminal item is selected
    terminal.on('select', function(item, index) {
      if(item == 'Cancel') return callback(Error('Cancelled by user'))
      callback(null, item, index)
    })

    terminal.on('error', function(err) {
      callback(err)
    })

    process.stdin.on('error', function(err) {
      callback(err)
    })

    return terminal
  }
347692
public boolean assist() {
        // Read the command line and provide assistance for the command line before the caret.
        final String commandLine = commandLineManager.getCommandLine();
        final int caret = commandLineManager.getCaret();
        final String commandLineToAssist = commandLine.substring(0, caret);
        final Opt<String> autoCompletedSuffix = shell.assist(commandLineToAssist);
        if (!autoCompletedSuffix.isPresent()) {
            return false;
        }

        // Don't overwrite any extra characters on the command line that came after the caret.
        final String extraCommandLine = commandLine.substring(caret);
        final String autoCompletedCommandLine = commandLineToAssist + autoCompletedSuffix.get();
        commandLineManager.setCommandLine(autoCompletedCommandLine + extraCommandLine);
        commandLineManager.setCaret(autoCompletedCommandLine.length());
        return true;
    }
346909
def prompt_terminal(path):
    """"""

    def rlinput(prompt_msg, prefill=''):
        """
        One line is read from standard input. Display `prompt_msg` on
        standard error. `prefill` is placed into the editing buffer
        before editing begins.
        """
        import readline
        readline.set_startup_hook(lambda: readline.insert_text(prefill))
        try:
            return input(prompt_msg)
        finally:
            readline.set_startup_hook()

    filepath, extension = os.path.splitext(path)
    basename = os.path.basename(filepath)
    dirname = os.path.dirname(filepath)

    # display filename prompt
    new_basename = rlinput('Filename: ', basename)

    # retry prompt if new filename already exists
    while os.path.exists(os.path.join(dirname, new_basename + extension)) and \
            new_basename != basename:
        new_basename = rlinput('Sorry, please try again... Filename: ',
                               basename)

    if new_basename == '':
        new_basename = basename

    return os.path.join(dirname, new_basename + extension)
1162670
function help (options) {
    const { cmds, desc } = options
    let commands = [
        '',
        'Commands:',
        ''
    ]
    
    cmds.forEach(function (v) {
        let item = pad(v.command + (v.aliases ? '|' + v.aliases : '')) + v.desc
        commands.push(item.replace(/^/gm, '    '))
    })
    
    const optionsList = [
        '',
        'Options:',
        '',
        (pad('-h, --help') + 'output usage information').replace(/^/gm, '    '),
        (pad('-v, --version') + 'output the version number').replace(/^/gm, '    '),
        '',
        ''
    ]
    
    process.stdout.write(['', desc].concat(commands, optionsList).join('\n'))
    process.exit()
}
125019
protected static function showHelp()
    {
        \cli\line();
        \cli\out(self::$arguments->getHelpScreen(\cli\Colors::colorize('%N%n%gAvailable commands:')));
        \cli\line();
    }
1262209
def print_task_help(self, task, name):
        
        TerminalColor.set('GREEN')
        print(get_signature(name, task))

        # TODO: print the location does not work properly and sometimes returns None
        # print('    => defined in: {}'.format(inspect.getsourcefile(task)))
        help_msg = inspect.getdoc(task) or ''
        TerminalColor.reset()
        print('   ' + help_msg.replace('\n', '\n   '))
        TerminalColor.reset()
        print()
822290
private void printHelpAndExit(int exitCode) {
    HelpFormatter hf = new HelpFormatter();

    hf.printHelp("gobblin-admin.sh <command> [options]", this.options);
    System.out.println("Valid commands:");
    for (String command : getCommandNames()) {
      System.out.println(command);
    }

    System.exit(exitCode);
  }
1010300
def cli():
    
    with open_client(cache_dir=get_cache_dir()) as client:
        tip = client.frog_tip()

    terminal_width = click.termui.get_terminal_size()[0]
    wisdom = make_frog_fresco(tip, width=terminal_width)

    click.echo(wisdom)