<commit_before>Class {
	#name : #ClapPillarBuildCommand,
	#superclass : #Object,
	#classInstVars : [
		'project'
	],
	#category : #'Pillar-Cli-Clap'
}

{ #category : #'as yet unclassified' }
ClapPillarBuildCommand class >> commandSpecification [
	<commandline>
	^ (ClapCommand id: #build)
		description: 'Build your Pillar documents and export with a given format';
		add:
			((ClapPositional id: #requestedBuilder)
				description: 'Format you want to export as';
				meaning: [ :m | m word asString ]);
		add:
			((ClapPositional id: #requestedFiles)
				description: 'Pillar files you want to build';
				multiple: true;
				meaning: [ :m | m word asString ]);
		add:
			((ClapFlag id: #all)
				description: 'Build all Pillar documents in repository';
				canonicalName: 'a');
		add:
			((ClapFlag id: #mainRoot)
				description: 'Build index.pillar in root directory';
				canonicalName: 'm');
		add:
			((ClapFlag id: #templatable)
				description: 'Use a template';
				canonicalName: 'templatable');
		meaning: [ :args | 
			| target result |
			target := PRTarget builderForName: (args at: #requestedBuilder) value.
			(args at: #requestedFiles) isExplicit
				ifFalse: [ target buildMainRoot ]
				ifTrue: [ 
					| requestedFiles |
					requestedFiles := (args occurrencesOf: #requestedFiles) collect: #value.
					target buildOnly: requestedFiles ].
			(args at: #templatable) isExplicit 
				ifTrue: [ (self project) beTemplatable ].
			(args at: #all) isExplicit 
				ifTrue: [ target buildAll ].
			(args at: #mainRoot ) isExplicit
				ifTrue: [ target buildMainRoot ].
			result := (self project) build: target.
			result exitProcess
			 ]
]

{ #category : #accessing }
ClapPillarBuildCommand class >> project [
	 ^ project ifNil: [ project := PRProject on: self workingDirectory ]
]

{ #category : #accessing }
ClapPillarBuildCommand class >> workingDirectory [ 
	
	^ FileSystem workingDirectory 
]<commit_msg>Build working from all directories with the following alias in .bachrc : alias clap-pillar = " <absolute pth to VM> <absolute path to image>  clap"<commit_after>Class {
	#name : #ClapPillarBuildCommand,
	#superclass : #Object,
	#classInstVars : [
		'project'
	],
	#category : #'Pillar-Cli-Clap'
}

{ #category : #'as yet unclassified' }
ClapPillarBuildCommand class >> commandSpecification [
	<commandline>
	^ (ClapCommand id: #build)
		description: 'Build your Pillar documents and export with a given format';
		add:
			((ClapPositional id: #requestedBuilder)
				description: 'Format you want to export as';
				meaning: [ :m | m word asString ]);
		add:
			((ClapPositional id: #requestedFiles)
				description: 'Pillar files you want to build';
				multiple: true;
				meaning: [ :m | m word asString ]);
		add:
			((ClapFlag id: #all)
				description: 'Build all Pillar documents in repository';
				canonicalName: 'a');
		add:
			((ClapFlag id: #mainRoot)
				description: 'Build index.pillar in root directory';
				canonicalName: 'm');
		add:
			((ClapFlag id: #templatable)
				description: 'Use a template';
				canonicalName: 'templatable');
		meaning: [ :args | 
			| target result |
			project := PRProject on: (FileSystem workingDirectory ).
			target := PRTarget builderForName: (args at: #requestedBuilder) value.
			(args at: #requestedFiles) isExplicit
				ifFalse: [ target buildMainRoot ]
				ifTrue: [ 
					| requestedFiles |
					requestedFiles := (args occurrencesOf: #requestedFiles) collect: #value.
					target buildOnly: requestedFiles ].
			(args at: #templatable) isExplicit 
				ifTrue: [ (self project) beTemplatable ].
			(args at: #all) isExplicit 
				ifTrue: [ target buildAll ].
			(args at: #mainRoot ) isExplicit
				ifTrue: [ target buildMainRoot ].
			result := (self project) build: target.
			result exitProcess
			 ]
]

{ #category : #accessing }
ClapPillarBuildCommand class >> project [
	 ^ project ifNil: [ project := PRProject on: (FileSystem workingDirectory )]
]
{'fraction_non_alphanumeric': 0.11725888324873096, 'fraction_numerical': 0.0, 'mean_word_length': 3.765417170495768, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '5928231', 'n_tokens_mistral': 1483, 'n_tokens_neox': 1245, 'n_words': 373}