<commit_before>package com.sequenceiq.ambari.shell;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.shell.commands.ExitCommands;
import org.springframework.shell.core.ExitShellRequest;
import org.springframework.shell.core.JLineShellComponent;

@Configuration
@ComponentScan(basePackageClasses={AmbariShell.class,ExitCommands.class})
public class AmbariShell implements CommandLineRunner 
{
	
	@Autowired
	GenericApplicationContext ctx;

	public void run(String... arg0) throws Exception {		
		JLineShellComponent shell = ctx.getBean("shell", JLineShellComponent.class);
		ExitShellRequest exitShellRequest;

		shell.start();
		shell.promptLoop();
		exitShellRequest = shell.getExitShellRequest();
		if (exitShellRequest == null) {
			// shouldn't really happen, but we'll fallback to this anyway
			exitShellRequest = ExitShellRequest.NORMAL_EXIT;
		}
		shell.waitForComplete();

		ctx.close();
	}
	
	public static void main(String[] args) {
		new SpringApplicationBuilder(AmbariShell.class)
		.showBanner(false)
		.run(args);
	}
}<commit_msg>only selected default commands are used: version / exit / help<commit_after>package com.sequenceiq.ambari.shell;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.shell.commands.ExitCommands;
import org.springframework.shell.commands.HelpCommands;
import org.springframework.shell.commands.VersionCommands;
import org.springframework.shell.core.CommandMarker;
import org.springframework.shell.core.ExitShellRequest;
import org.springframework.shell.core.JLineShellComponent;

@Configuration
@ComponentScan(basePackageClasses={AmbariShell.class})
public class AmbariShell implements CommandLineRunner 
{
	
	@Bean
	public CommandMarker exitCommand() {
		return new ExitCommands();
	}

	@Bean
	public CommandMarker versionCommands() {
		return new VersionCommands();
	}

	@Bean
	public CommandMarker helpCommands() {
		return new HelpCommands();
	}

	
	@Autowired
	GenericApplicationContext ctx;

	public void run(String... arg0) throws Exception {		
		JLineShellComponent shell = ctx.getBean("shell", JLineShellComponent.class);
		ExitShellRequest exitShellRequest;

		shell.start();
		shell.promptLoop();
		exitShellRequest = shell.getExitShellRequest();
		if (exitShellRequest == null) {
			// shouldn't really happen, but we'll fallback to this anyway
			exitShellRequest = ExitShellRequest.NORMAL_EXIT;
		}
		shell.waitForComplete();

		ctx.close();
	}
	
	public static void main(String[] args) {
		new SpringApplicationBuilder(AmbariShell.class)
		.showBanner(false)
		.run(args);
	}
}
{'fraction_non_alphanumeric': 0.09525258673158855, 'fraction_numerical': 0.0006086427267194157, 'mean_word_length': 6.1612200435729845, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2493878', 'n_tokens_mistral': 932, 'n_tokens_neox': 884, 'n_words': 179}