Coverage for src/features/argcomplete.py: 75.00%
12 statements
« prev ^ index » next coverage.py v7.17.2, created at 2026-11-08 13:49 +0000
« prev ^ index » next coverage.py v7.17.2, created at 2026-11-08 13:49 +0000
1#!/usr/bin/env python3
3# Standard libraries
4from pathlib import Path
6# Components
7from ..system.commands import Commands
9# Argcomplete class
10class Argcomplete:
12 # Constants
13 BINARY: str = 'activate-global-python-argcomplete'
14 MARKER: str = 'added by argcomplete'
16 # Configure
17 @staticmethod
18 def configure() -> bool:
20 # Configure argcomplete
21 return Commands.run(Argcomplete.BINARY, [
22 '--user',
23 ])
25 # Configured
26 @staticmethod
27 def configured() -> bool:
29 # Variables
30 user_home: Path = Path.home()
32 # Detect configured files
33 return Commands.grep(
34 Path(user_home / '.bash_completion'),
35 Argcomplete.MARKER,
36 ) and Commands.grep(
37 Path(user_home / '.zshenv'),
38 Argcomplete.MARKER,
39 )