|
1 | 1 | function Set-PromptSettings {
|
2 | 2 | [CmdletBinding()]
|
3 | 3 | param(
|
4 |
| - [string]$BeforeText = "[", |
5 |
| - [ConsoleColor]$BeforeForeground, |
6 |
| - [ConsoleColor]$BeforeBackground, |
| 4 | + [string]$AfterChangesText = "]:", |
| 5 | + [ConsoleColor]$AfterChangesForeground, |
| 6 | + [ConsoleColor]$AfterChangesBackground, |
7 | 7 |
|
8 |
| - [string]$BranchText = $([char]0x03BB), |
9 |
| - [ConsoleColor]$BranchForeground, |
10 |
| - [ConsoleColor]$BranchBackground, |
| 8 | + [string]$AfterNoChangesText = "]:", |
| 9 | + [ConsoleColor]$AfterNoChangesForeground, |
| 10 | + [ConsoleColor]$AfterNoChangesBackground, |
11 | 11 |
|
| 12 | + [string]$AheadByText = '▲', |
12 | 13 | [ConsoleColor]$AheadByForeground,
|
13 | 14 | [ConsoleColor]$AheadByBackground,
|
14 | 15 |
|
| 16 | + [string]$BehindByText = '▼', |
15 | 17 | [ConsoleColor]$BehindByForeground,
|
16 | 18 | [ConsoleColor]$BehindByBackground,
|
17 | 19 |
|
18 |
| - [string]$BeforeChanges = '', |
| 20 | + [string]$BeforeText = "[", |
| 21 | + [ConsoleColor]$BeforeForeground, |
| 22 | + [ConsoleColor]$BeforeBackground, |
| 23 | + |
| 24 | + [string]$BranchText = $([char]0x03BB), |
| 25 | + [ConsoleColor]$BranchForeground, |
| 26 | + [ConsoleColor]$BranchBackground, |
| 27 | + |
| 28 | + [string]$BeforeChangesText = '', |
19 | 29 | [ConsoleColor]$BeforeChangesForeground,
|
20 | 30 | [ConsoleColor]$BeforeChangesBackground,
|
21 | 31 |
|
22 |
| - [ConsoleColor]$StagedChangesForeground, |
23 |
| - [ConsoleColor]$StagedChangesBackground, |
24 |
| - |
25 |
| - [string]$Separator = '|', |
| 32 | + [string]$SeparatorText = '|', |
26 | 33 | [ConsoleColor]$SeparatorForeground,
|
27 | 34 | [ConsoleColor]$SeparatorBackground,
|
28 | 35 |
|
| 36 | + [ConsoleColor]$StagedChangesForeground, |
| 37 | + [ConsoleColor]$StagedChangesBackground, |
| 38 | + |
29 | 39 | [ConsoleColor]$UnStagedChangesForeground,
|
30 | 40 | [ConsoleColor]$UnStagedChangesBackground,
|
31 | 41 |
|
32 |
| - [string]$AfterChanges = "]:", |
33 |
| - [ConsoleColor]$AfterChangesForeground, |
34 |
| - [ConsoleColor]$AfterChangesBackground, |
35 |
| - |
36 |
| - [string]$AfterNoChanges = "]:", |
37 |
| - [ConsoleColor]$AfterNoChangesForeground, |
38 |
| - [ConsoleColor]$AfterNoChangesBackground, |
39 | 42 | [Switch]$HideZero
|
40 | 43 | )
|
41 | 44 |
|
42 | 45 | $config = Import-Configuration
|
43 | 46 |
|
44 | 47 | switch($PSBoundParameters.Keys) {
|
45 |
| - "BeforeText" { |
46 |
| - $config.Before.Object = $PSBoundParameters[$_] |
47 |
| - } |
48 |
| - "BeforeForeground" { |
49 |
| - $config.Before.Foreground = $PSBoundParameters[$_] |
50 |
| - } |
51 |
| - "BeforeBackground" { |
52 |
| - $config.Before.Background = $PSBoundParameters[$_] |
53 |
| - } |
54 |
| - "BranchText" { |
55 |
| - $config.Branch.Object = $PSBoundParameters[$_] |
56 |
| - } |
57 |
| - "BranchForeground" { |
58 |
| - $config.Branch.Foreground = $PSBoundParameters[$_] |
59 |
| - } |
60 |
| - "BranchBackground" { |
61 |
| - $config.Branch.Background = $PSBoundParameters[$_] |
62 |
| - } |
63 |
| - "AheadByForeground" { |
64 |
| - $config.AheadBy.Foreground = $PSBoundParameters[$_] |
65 |
| - } |
66 |
| - "AheadByBackground" { |
67 |
| - $config.AheadBy.Background = $PSBoundParameters[$_] |
68 |
| - } |
69 |
| - "BehindByForeground" { |
70 |
| - $config.BehindBy.Foreground = $PSBoundParameters[$_] |
71 |
| - } |
72 |
| - "BehindByBackground" { |
73 |
| - $config.BehindBy.Background = $PSBoundParameters[$_] |
74 |
| - } |
75 |
| - "BeforeChangesText" { |
76 |
| - $config.BeforeChanges.Object = $PSBoundParameters[$_] |
77 |
| - } |
78 |
| - "BeforeChangesForeground" { |
79 |
| - $config.BeforeChanges.Foreground = $PSBoundParameters[$_] |
80 |
| - } |
81 |
| - "BeforeChangesBackground" { |
82 |
| - $config.BeforeChanges.Background = $PSBoundParameters[$_] |
83 |
| - } |
84 |
| - "StagedChangesForeground" { |
85 |
| - $config.StagedChanges.Foreground = $PSBoundParameters[$_] |
86 |
| - } |
87 |
| - "StagedChangesBackground" { |
88 |
| - $config.StagedChanges.Background = $PSBoundParameters[$_] |
89 |
| - } |
90 |
| - "UnStagedChangesForeground" { |
91 |
| - $config.UnStagedChanges.Foreground = $PSBoundParameters[$_] |
92 |
| - } |
93 |
| - "UnStagedChangesBackground" { |
94 |
| - $config.UnStagedChanges.Background = $PSBoundParameters[$_] |
95 |
| - } |
96 |
| - "AfterChangesText" { |
97 |
| - $config.AfterChanges.Object = $PSBoundParameters[$_] |
98 |
| - } |
99 |
| - "AfterChangesForeground" { |
100 |
| - $config.AfterChanges.Foreground = $PSBoundParameters[$_] |
101 |
| - } |
102 |
| - "AfterChangesBackground" { |
103 |
| - $config.AfterChanges.Background = $PSBoundParameters[$_] |
104 |
| - } |
105 |
| - "AfterNoChangesText" { |
106 |
| - $config.AfterNoChanges.Object = $PSBoundParameters[$_] |
107 |
| - } |
108 |
| - "AfterNoChangesForeground" { |
109 |
| - $config.AfterNoChanges.Foreground = $PSBoundParameters[$_] |
110 |
| - } |
111 |
| - "AfterNoChangesBackground" { |
112 |
| - $config.AfterNoChanges.Background = $PSBoundParameters[$_] |
113 |
| - } |
114 |
| - "HideZero" { |
115 |
| - $Config.HideZero = $PSBoundParameters[$_] |
116 |
| - } |
| 48 | + "AfterChangesText" { $config.AfterChanges.Object = $PSBoundParameters[$_] } |
| 49 | + "AfterChangesBackground" { $config.AfterChanges.Background = $PSBoundParameters[$_] } |
| 50 | + "AfterChangesForeground" { $config.AfterChanges.Foreground = $PSBoundParameters[$_] } |
| 51 | + |
| 52 | + "AfterNoChangesText" { $config.AfterNoChanges.Object = $PSBoundParameters[$_] } |
| 53 | + "AfterNoChangesBackground" { $config.AfterNoChanges.Background = $PSBoundParameters[$_] } |
| 54 | + "AfterNoChangesForeground" { $config.AfterNoChanges.Foreground = $PSBoundParameters[$_] } |
| 55 | + |
| 56 | + "AheadByText" { $config.AheadBy.Object = $PSBoundParameters[$_] } |
| 57 | + "AheadByBackground" { $config.AheadBy.Background = $PSBoundParameters[$_] } |
| 58 | + "AheadByForeground" { $config.AheadBy.Foreground = $PSBoundParameters[$_] } |
| 59 | + |
| 60 | + "BeforeText" { $config.Before.Object = $PSBoundParameters[$_] } |
| 61 | + "BeforeBackground" { $config.Before.Background = $PSBoundParameters[$_] } |
| 62 | + "BeforeForeground" { $config.Before.Foreground = $PSBoundParameters[$_] } |
| 63 | + |
| 64 | + "BeforeChangesText" { $config.BeforeChanges.Object = $PSBoundParameters[$_] } |
| 65 | + "BeforeChangesBackground" { $config.BeforeChanges.Background = $PSBoundParameters[$_] } |
| 66 | + "BeforeChangesForeground" { $config.BeforeChanges.Foreground = $PSBoundParameters[$_] } |
| 67 | + |
| 68 | + "BehindByText" { $config.BehindBy.Object = $PSBoundParameters[$_] } |
| 69 | + "BehindByBackground" { $config.BehindBy.Background = $PSBoundParameters[$_] } |
| 70 | + "BehindByForeground" { $config.BehindBy.Foreground = $PSBoundParameters[$_] } |
| 71 | + |
| 72 | + "BranchText" { $config.Branch.Object = $PSBoundParameters[$_] } |
| 73 | + "BranchBackground" { $config.Branch.Background = $PSBoundParameters[$_] } |
| 74 | + "BranchForeground" { $config.Branch.Foreground = $PSBoundParameters[$_] } |
| 75 | + |
| 76 | + "SeparatorText" { $Config.Separator.Object = $PSBoundParameters[$_] } |
| 77 | + "SeparatorBackground" { $Config.Separator.Background = $PSBoundParameters[$_] } |
| 78 | + "SeparatorForeground" { $Config.Separator.Foreground = $PSBoundParameters[$_] } |
| 79 | + |
| 80 | + "StagedChangesBackground" { $config.StagedChanges.Background = $PSBoundParameters[$_] } |
| 81 | + "StagedChangesForeground" { $config.StagedChanges.Foreground = $PSBoundParameters[$_] } |
| 82 | + |
| 83 | + "UnStagedChangesBackground" { $config.UnStagedChanges.Background = $PSBoundParameters[$_] } |
| 84 | + "UnStagedChangesForeground" { $config.UnStagedChanges.Foreground = $PSBoundParameters[$_] } |
| 85 | + |
| 86 | + "HideZero" { $Config.HideZero = [bool]$HideZero } |
117 | 87 | }
|
118 | 88 |
|
119 | 89 | Export-Configuration $config
|
|
0 commit comments