support extracting config values

This commit is contained in:
Valentin Boettcher 2024-04-05 20:34:20 -04:00
parent c533eb92d7
commit 220d76c48f
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE
2 changed files with 6 additions and 0 deletions

View file

@ -22,3 +22,8 @@ def get_config(profile):
AccessTokenFileName = cache_path / "imap_smtp_access_token",
Authority = config_data["Authority"] or None,
Timeout = config_data.get("Timeout", 60 * 60))
if __name__ == "__main__":
if len(sys.argv) < 3:
sys.exit(f"Usage: {sys.argv[0]} <profile> <key>")
print(get_config(sys.argv[1]).__dict__[sys.argv[2]])

View file

@ -30,6 +30,7 @@
install -Dm755 ${./get_token.py} $out/bin/o365-get-token
install -Dm755 ${./refresh_token.py} $out/bin/o365-refresh-token
install -Dm755 ${./config.py} $out/bin/config.py
install -Dm755 ${./config.py} $out/bin/o365-get-config
'';
};
});