Skip to content

Commit ac14037

Browse files
committed
Added variables <RESearchPattern> to gam config|select verify
1 parent 6135e5c commit ac14037

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

src/GamCommands.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,11 +1290,12 @@ Specify a collection of items by directly specifying them; the item type is dete
12901290

12911291
## Select a section from gam.cfg and process a GAM command using values from that section
12921292
<Select> ::=
1293-
select <Section> [save] [verify]
1293+
select <Section> [save] [verify [variables <RESearchPattern>]]
12941294
save
12951295
Set section = <Section> in the [DEFAULT] section and write configuration data to gam.cfg
12961296
verify
12971297
Print the variable values for the selected section
1298+
Use `variables <RESearchPattern>` to display variables with names selected by `<RESearchPattern>`
12981299
Values are determined in this order: Selected section, DEFAULT section, Program default
12991300

13001301
## Display all of the sections in gam.cfg and mark the currently selected section with a *.
@@ -1318,7 +1319,7 @@ csv_input_row_drop_filter, csv_input_row_drop_filter_mode and csv_input_row_limi
13181319
## Set variables in gam.cfg.
13191320

13201321
<Config> ::=
1321-
config (<VariableName> [=] <Value>)* [save] [verify]
1322+
config (<VariableName> [=] <Value>)* [save] [verify [variables <RESearchPattern>]]
13221323
<VariableName> [=] <Value>
13231324
Set <VariableName> = <Value> in the current section
13241325
All <VariableNames> except section are allowed.
@@ -1327,6 +1328,7 @@ save
13271328
Write configuration data to gam.cfg
13281329
verify
13291330
Print the variable values for the current section
1331+
Use `variables <RESearchPattern>` to display variables with names selected by `<RESearchPattern>`.
13301332
Values are determined in this order: Current section, DEFAULT section, Program default
13311333

13321334
## Terminate processing of a CSV or batch file when one of the subprocesses returns a matching return code.

src/GamUpdate.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
7.31.05
2+
3+
Added option `variables <RESearchPattern>` to `gam select section <SectionName> verify` and `gam config verify`
4+
that causes GAM to only display variables with names selected by `<RESearchPattern>`.
5+
```
6+
gam select School verify variables "^(customer|domain)"
7+
Section: School
8+
customer_id = C03abc123
9+
domain = school.edu
10+
11+
gam config verify variables 'dir'
12+
Section: DEFAULT
13+
cache_dir = ~/GamConfig/gamcache ; /Users/gamteam/GamConfig/gamcache
14+
config_dir = ~/GamConfig ; /Users/gamteam/GamConfig
15+
drive_dir = ~/GamWork ; /Users/gamteam/GamWork
16+
gmail_cse_incert_dir = ~/GmailCSE/Certs ; /Users/gamteam/GmailCSE/Certs
17+
gmail_cse_inkey_dir = ~/GmailCSE/Keys ; /Users/gamteam/GmailCSE/Keys
18+
input_dir = .
19+
```
20+
121
7.31.04
222

323
Fixed bug in `gam report admin|chrome` that caused to events to not be displayed.

src/gam/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# GAM7
55
#
6-
# Copyright 2025, All Rights Reserved.
6+
# Copyright 2026, All Rights Reserved.
77
#
88
# Licensed under the Apache License, Version 2.0 (the "License");
99
# you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
2525
"""
2626

2727
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
28-
__version__ = '7.31.04'
28+
__version__ = '7.31.05'
2929
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
3030

3131
#pylint: disable=wrong-import-position
@@ -3831,9 +3831,12 @@ def _writeGamCfgFile(config, fileName, action):
38313831
stderrErrorMsg(fileErrorMessage(fileName, e, Ent.CONFIG_FILE))
38323832

38333833
def _verifyValues(sectionName, inputFilterSectionName, outputFilterSectionName):
3834+
itemNamePattern = getREPattern() if checkArgumentPresent('variables') else None
38343835
printKeyValueList([Ent.Singular(Ent.SECTION), sectionName]) # Do not use printEntity
38353836
Ind.Increment()
38363837
for itemName, itemEntry in GC.VAR_INFO.items():
3838+
if itemNamePattern and not itemNamePattern.search(itemName):
3839+
continue
38373840
sectName = sectionName
38383841
if itemName in GC.CSV_INPUT_ROW_FILTER_ITEMS:
38393842
if inputFilterSectionName:
@@ -4014,7 +4017,7 @@ def _setMultiprocessExit():
40144017
usageErrorExit(formatKeyValueList('', [EV_GAMCFGSECTION, sectionName, 'select', Msg.NOT_ALLOWED], ''))
40154018
else:
40164019
sectionName = _getCfgSection(configparser.DEFAULTSECT, GC.SECTION)
4017-
# select <SectionName> [save] [verify]
4020+
# select <SectionName> [save] [verify [variables <RESearchPattern>]]
40184021
if checkArgumentPresent(Cmd.SELECT_CMD):
40194022
sectionName = _selectSection()
40204023
GM.Globals[GM.SECTION] = sectionName # Save section for inner gams
@@ -4065,7 +4068,7 @@ def _setMultiprocessExit():
40654068
if GM.Globals[GM.PARSER].has_option(section, GC.CMDLOG_MAX__BACKUPS):
40664069
GM.Globals[GM.PARSER].set(section, GC.CMDLOG_MAX_BACKUPS, GM.Globals[GM.PARSER].get(section, GC.CMDLOG_MAX__BACKUPS))
40674070
GM.Globals[GM.PARSER].remove_option(section, GC.CMDLOG_MAX__BACKUPS)
4068-
# config (<VariableName> [=] <Value>)* [save] [verify]
4071+
# config (<VariableName> [=] <Value>)* [save] [verify [variables <RESearchPattern>]]
40694072
if checkArgumentPresent(Cmd.CONFIG_CMD):
40704073
while Cmd.ArgumentsRemaining():
40714074
if checkArgumentPresent('save'):

0 commit comments

Comments
 (0)